local corrupted = {
	{itemid = 11752, position = Position(33614,32724, 12)},
	{itemid = 11752, position = Position(33620,32713, 12)},
	{itemid = 11752, position = Position(33619,32727, 12)},
	{itemid = 11752, position = Position(33615,32715, 12)},
	{itemid = 11752, position = Position(33622,32712, 12)},
	{itemid = 11752, position = Position(33620,32726, 12)},
	{itemid = 11751, position = Position(33613,32715, 12)},
	{itemid = 11751, position = Position(33618,32712, 12)},
	{itemid = 11751, position = Position(33613,32725, 12)},
	{itemid = 11751, position = Position(33624,32718, 12)},
	{itemid = 11751, position = Position(33612,32714, 12)},
	{itemid = 11751, position = Position(33612,32724, 12)},
	{itemid = 11751, position = Position(33619,32713, 12)},
	{itemid = 11750, position = Position(33615,32723, 12)},
	{itemid = 11750, position = Position(33612,32718, 12)},
	{itemid = 11750, position = Position(33613,32720, 12)},
	{itemid = 11750, position = Position(33614,32721, 12)},
	{itemid = 11750, position = Position(33621,32725, 12)},
	{itemid = 11750, position = Position(33615,32714, 12)},
	{itemid = 11750, position = Position(33614,32713, 12)},
	{itemid = 11749, position = Position(33624,32717, 12)},
	{itemid = 11749, position = Position(33625,32716, 12)},
	{itemid = 11749, position = Position(33618,32726, 12)},
	{itemid = 11749, position = Position(33616,32727, 12)},
	{itemid = 11749, position = Position(33619,32725, 12)},
	{itemid = 11748, position = Position(33614,32723, 12)},
	{itemid = 11748, position = Position(33613,32724, 12)},
	{itemid = 11748, position = Position(33619,32726, 12)},
	{itemid = 11748, position = Position(33620,32725, 12)},
	{itemid = 11748, position = Position(33620,32712, 12)},
	{itemid = 11747, position = Position(33613,32714, 12)},
	{itemid = 11747, position = Position(33619,32712, 12)},
	{itemid = 11747, position = Position(33613,32724, 12)},
	{itemid = 11747, position = Position(33612,32713, 12)},
	{itemid = 11747, position = Position(33612,32723, 12)},
	{itemid = 11746, position = Position(33614,32714, 12)},
	{itemid = 11746, position = Position(33614,32723, 12)},
	{itemid = 11746, position = Position(33612,32720, 12)},
	{itemid = 11746, position = Position(33613,32721, 12)},
	{itemid = 11746, position = Position(33613,32713, 12)},
	{itemid = 11745, position = Position(33618,32727, 12)},
	{itemid = 11745, position = Position(33619,32726, 12)},
	{itemid = 11745, position = Position(33625,32717, 12)},
	{itemid = 11743, position = Position(33621,32725, 12)},
	{itemid = 11743, position = Position(33621,32712, 12)},
	{itemid = 11743, position = Position(33615,32723, 12)},
	{itemid = 11743, position = Position(33611,32713, 12)},
	{itemid = 11743, position = Position(33611,32723, 12)},
	{itemid = 11743, position = Position(33614,32715, 12)},
	{itemid = 11742, position = Position(33614,32722, 12)},
	{itemid = 11742, position = Position(33613,32725, 12)},
	{itemid = 11742, position = Position(33612,32719, 12)},
	{itemid = 11742, position = Position(33613,32712, 12)},
	{itemid = 11741, position = Position(33620,32725, 12)},
	{itemid = 11741, position = Position(33617,32727, 12)},
	{itemid = 11741, position = Position(33611,32718, 12)},
	{itemid = 11739, position = Position(33625,32720, 12)},
	{itemid = 11735, position = Position(33625,32718, 12)},
	{itemid = 11732, position = Position(33625,32719, 12)},
	{itemid = 11696, position = Position(33619,32724, 12)},
	{itemid = 11693, position = Position(33613,32722, 12)},
	{itemid = 11692, position = Position(33619,32721, 12)},
	{itemid = 11691, position = Position(33623,32720, 12)},
	{itemid = 11666, position = Position(33620,32723, 12)},
	{itemid = 11664, position = Position(33615,32719, 12)},
	{itemid = 11649, position = Position(33622,32720, 12)},
	{itemid = 11649, position = Position(33618,32716, 12)},
	{itemid = 11648, position = Position(33617,32717, 12)},
	{itemid = 11647, position = Position(33621,32721, 12)},
	{itemid = 11646, position = Position(33621,32712, 12)},
	{itemid = 11646, position = Position(33625,32718, 12)},
	{itemid = 11645, position = Position(33618,32726, 12)},
	{itemid = 11645, position = Position(33624,32717, 12)},
	{itemid = 11644, position = Position(33620,32712, 12)},
	{itemid = 11644, position = Position(33614,32713, 12)},
	{itemid = 11643, position = Position(33613,32724, 12)},
	{itemid = 11642, position = Position(33613,32714, 12)},
	{itemid = 11641, position = Position(33614,32724, 12)},
	{itemid = 11641, position = Position(33619,32726, 12)},
	{itemid = 11638, position = Position(33614,32715, 12)},
	{itemid = 11560, position = Position(33616,32722, 12)},
	{itemid = 11559, position = Position(33620,32721, 12)},
	{itemid = 11559, position = Position(33621,32720, 12)},
	{itemid = 11559, position = Position(33618,32722, 12)},
	{itemid = 11558, position = Position(33621,32717, 12)},
	{itemid = 11557, position = Position(33616,32719, 12)},
	{itemid = 11557, position = Position(33617,32718, 12)},
	{itemid = 11557, position = Position(33618,32717, 12)},
	{itemid = 11555, position = Position(33617,32719, 12)},
	{itemid = 11555, position = Position(33618,32718, 12)},
	{itemid = 11554, position = Position(33620,32720, 12)},
	{itemid = 11554, position = Position(33618,32721, 12)},
	{itemid = 11552, position = Position(33621,32719, 12)},
	{itemid = 11552, position = Position(33621,32718, 12)},
	{itemid = 11551, position = Position(33617,32722, 12)},
	{itemid = 11551, position = Position(33619,32721, 12)},
	{itemid = 11550, position = Position(33616,32721, 12)},
	{itemid = 11550, position = Position(33616,32720, 12)},
	{itemid = 11549, position = Position(33620,32717, 12)},
	{itemid = 11549, position = Position(33619,32717, 12)},
	{itemid = 11548, position = Position(33619, 32718, 12)},
	{itemid = 11548, position = Position(33620, 32718, 12)},
	{itemid = 11548, position = Position(33618, 32719, 12)},
	{itemid = 11548, position = Position(33619, 32719, 12)},
	{itemid = 11548, position = Position(33620, 32719, 12)},
	{itemid = 11548, position = Position(33617, 32720, 12)},
	{itemid = 11548, position = Position(33618, 32720, 12)},
	{itemid = 11548, position = Position(33619, 32720, 12)},
	{itemid = 11548, position = Position(33617, 32721, 12)},
	{itemid = 11504, position = Position(33619,32722, 12)},
	{itemid = 11504, position = Position(33621,32715, 12)},
	{itemid = 11504, position = Position(33619,32721, 12)},
	{itemid = 11504, position = Position(33620,32723, 12)},
	{itemid = 11504, position = Position(33621,32716, 12)},
	{itemid = 11504, position = Position(33621,32714, 12)},
	{itemid = 11504, position = Position(33619,32716, 12)},
	{itemid = 11504, position = Position(33619,32717, 12)},
	{itemid = 11504, position = Position(33619,32723, 12)},
	{itemid = 11504, position = Position(33619,32724, 12)},
	{itemid = 11504, position = Position(33620,32724, 12)},
	{itemid = 11504, position = Position(33620,32721, 12)},
	{itemid = 11504, position = Position(33620,32727, 12)},
	{itemid = 11504, position = Position(33620,32722, 12)},
	{itemid = 11504, position = Position(33621,32713, 12)},
	{itemid = 11504, position = Position(33620,32720, 12)},
	{itemid = 11504, position = Position(33620,32716, 12)},
	{itemid = 11504, position = Position(33620,32717, 12)},
	{itemid = 11504, position = Position(33620,32714, 12)},
	{itemid = 11504, position = Position(33621,32717, 12)},
	{itemid = 11504, position = Position(33620,32715, 12)},
	{itemid = 11504, position = Position(33625,32727, 12)},
	{itemid = 11504, position = Position(33621,32719, 12)},
	{itemid = 11504, position = Position(33624,32715, 12)},
	{itemid = 11504, position = Position(33624,32714, 12)},
	{itemid = 11504, position = Position(33624,32713, 12)},
	{itemid = 11504, position = Position(33624,32716, 12)},
	{itemid = 11504, position = Position(33624,32720, 12)},
	{itemid = 11504, position = Position(33624,32719, 12)},
	{itemid = 11504, position = Position(33624,32721, 12)},
	{itemid = 11504, position = Position(33624,32712, 12)},
	{itemid = 11504, position = Position(33623,32726, 12)},
	{itemid = 11504, position = Position(33623,32722, 12)},
	{itemid = 11504, position = Position(33623,32727, 12)},
	{itemid = 11504, position = Position(33623,32723, 12)},
	{itemid = 11504, position = Position(33623,32725, 12)},
	{itemid = 11504, position = Position(33623,32724, 12)},
	{itemid = 11504, position = Position(33623,32721, 12)},
	{itemid = 11504, position = Position(33624,32722, 12)},
	{itemid = 11504, position = Position(33624,32724, 12)},
	{itemid = 11504, position = Position(33625,32722, 12)},
	{itemid = 11504, position = Position(33625,32721, 12)},
	{itemid = 11504, position = Position(33625,32723, 12)},
	{itemid = 11504, position = Position(33625,32725, 12)},
	{itemid = 11504, position = Position(33625,32724, 12)},
	{itemid = 11504, position = Position(33624,32723, 12)},
	{itemid = 11504, position = Position(33625,32715, 12)},
	{itemid = 11504, position = Position(33625,32713, 12)},
	{itemid = 11504, position = Position(33624,32725, 12)},
	{itemid = 11504, position = Position(33625,32714, 12)},
	{itemid = 11504, position = Position(33624,32726, 12)},
	{itemid = 11504, position = Position(33625,32712, 12)},
	{itemid = 11504, position = Position(33624,32727, 12)},
	{itemid = 11504, position = Position(33621,32718, 12)},
	{itemid = 11504, position = Position(33623,32720, 12)},
	{itemid = 11504, position = Position(33623,32718, 12)},
	{itemid = 11504, position = Position(33622,32715, 12)},
	{itemid = 11504, position = Position(33622,32714, 12)},
	{itemid = 11504, position = Position(33622,32713, 12)},
	{itemid = 11504, position = Position(33622,32716, 12)},
	{itemid = 11504, position = Position(33622,32718, 12)},
	{itemid = 11504, position = Position(33622,32717, 12)},
	{itemid = 11504, position = Position(33619,32715, 12)},
	{itemid = 11504, position = Position(33621,32727, 12)},
	{itemid = 11504, position = Position(33621,32724, 12)},
	{itemid = 11504, position = Position(33621,32720, 12)},
	{itemid = 11504, position = Position(33621,32726, 12)},
	{itemid = 11504, position = Position(33621,32721, 12)},
	{itemid = 11504, position = Position(33621,32723, 12)},
	{itemid = 11504, position = Position(33621,32722, 12)},
	{itemid = 11504, position = Position(33623,32719, 12)},
	{itemid = 11504, position = Position(33622,32719, 12)},
	{itemid = 11504, position = Position(33622,32721, 12)},
	{itemid = 11504, position = Position(33623,32714, 12)},
	{itemid = 11504, position = Position(33623,32713, 12)},
	{itemid = 11504, position = Position(33623,32715, 12)},
	{itemid = 11504, position = Position(33623,32717, 12)},
	{itemid = 11504, position = Position(33623,32716, 12)},
	{itemid = 11504, position = Position(33622,32720, 12)},
	{itemid = 11504, position = Position(33623,32712, 12)},
	{itemid = 11504, position = Position(33622,32726, 12)},
	{itemid = 11504, position = Position(33622,32722, 12)},
	{itemid = 11504, position = Position(33622,32727, 12)},
	{itemid = 11504, position = Position(33622,32723, 12)},
	{itemid = 11504, position = Position(33622,32725, 12)},
	{itemid = 11504, position = Position(33622,32724, 12)},
	{itemid = 11504, position = Position(33619,32714, 12)},
	{itemid = 11504, position = Position(33618,32716, 12)},
	{itemid = 11504, position = Position(33614,32727, 12)},
	{itemid = 11504, position = Position(33615,32719, 12)},
	{itemid = 11504, position = Position(33615,32720, 12)},
	{itemid = 11504, position = Position(33615,32721, 12)},
	{itemid = 11504, position = Position(33615,32722, 12)},
	{itemid = 11504, position = Position(33615,32718, 12)},
	{itemid = 11504, position = Position(33615,32716, 12)},
	{itemid = 11504, position = Position(33615,32717, 12)},
	{itemid = 11504, position = Position(33611,32725, 12)},
	{itemid = 11504, position = Position(33611,32724, 12)},
	{itemid = 11504, position = Position(33615,32713, 12)},
	{itemid = 11504, position = Position(33615,32724, 12)},
	{itemid = 11504, position = Position(33615,32726, 12)},
	{itemid = 11504, position = Position(33616,32715, 12)},
	{itemid = 11504, position = Position(33616,32716, 12)},
	{itemid = 11504, position = Position(33616,32717, 12)},
	{itemid = 11504, position = Position(33615,32725, 12)},
	{itemid = 11504, position = Position(33616,32714, 12)},
	{itemid = 11504, position = Position(33612,32727, 12)},
	{itemid = 11504, position = Position(33616,32713, 12)},
	{itemid = 11504, position = Position(33615,32727, 12)},
	{itemid = 11504, position = Position(33616,32718, 12)},
	{itemid = 11504, position = Position(33615,32712, 12)},
	{itemid = 11504, position = Position(33614,32726, 12)},
	{itemid = 11504, position = Position(33613,32719, 12)},
	{itemid = 11504, position = Position(33613,32726, 12)},
	{itemid = 11504, position = Position(33613,32727, 12)},
	{itemid = 11504, position = Position(33614,32712, 12)},
	{itemid = 11504, position = Position(33613,32718, 12)},
	{itemid = 11504, position = Position(33613,32716, 12)},
	{itemid = 11504, position = Position(33613,32717, 12)},
	{itemid = 11504, position = Position(33612,32725, 12)},
	{itemid = 11504, position = Position(33611,32726, 12)},
	{itemid = 11504, position = Position(33612,32717, 12)},
	{itemid = 11504, position = Position(33612,32715, 12)},
	{itemid = 11504, position = Position(33614,32720, 12)},
	{itemid = 11504, position = Position(33611,32727, 12)},
	{itemid = 11504, position = Position(33614,32725, 12)},
	{itemid = 11504, position = Position(33612,32716, 12)},
	{itemid = 11504, position = Position(33614,32719, 12)},
	{itemid = 11504, position = Position(33614,32717, 12)},
	{itemid = 11504, position = Position(33614,32718, 12)},
	{itemid = 11504, position = Position(33614,32716, 12)},
	{itemid = 11504, position = Position(33616,32719, 12)},
	{itemid = 11504, position = Position(33616,32712, 12)},
	{itemid = 11504, position = Position(33616,32720, 12)},
	{itemid = 11504, position = Position(33611,32716, 12)},
	{itemid = 11504, position = Position(33618,32713, 12)},
	{itemid = 11504, position = Position(33618,32714, 12)},
	{itemid = 11504, position = Position(33618,32715, 12)},
	{itemid = 11504, position = Position(33611,32717, 12)},
	{itemid = 11504, position = Position(33617,32725, 12)},
	{itemid = 11504, position = Position(33617,32726, 12)},
	{itemid = 11504, position = Position(33617,32724, 12)},
	{itemid = 11504, position = Position(33617,32723, 12)},
	{itemid = 11504, position = Position(33611,32715, 12)},
	{itemid = 11504, position = Position(33618,32717, 12)},
	{itemid = 11504, position = Position(33618,32724, 12)},
	{itemid = 11504, position = Position(33618,32725, 12)},
	{itemid = 11504, position = Position(33611,32714, 12)},
	{itemid = 11504, position = Position(33625,32726, 12)},
	{itemid = 11504, position = Position(33618,32723, 12)},
	{itemid = 11504, position = Position(33618,32721, 12)},
	{itemid = 11504, position = Position(33618,32722, 12)},
	{itemid = 11504, position = Position(33618,32718, 12)},
	{itemid = 11504, position = Position(33617,32722, 12)},
	{itemid = 11504, position = Position(33612,32726, 12)},
	{itemid = 11504, position = Position(33616,32726, 12)},
	{itemid = 11504, position = Position(33616,32723, 12)},
	{itemid = 11504, position = Position(33617,32714, 12)},
	{itemid = 11504, position = Position(33617,32715, 12)},
	{itemid = 11504, position = Position(33617,32713, 12)},
	{itemid = 11504, position = Position(33616,32725, 12)},
	{itemid = 11504, position = Position(33617,32712, 12)},
	{itemid = 11504, position = Position(33616,32724, 12)},
	{itemid = 11504, position = Position(33616,32722, 12)},
	{itemid = 11504, position = Position(33617,32716, 12)},
	{itemid = 11504, position = Position(33617,32718, 12)},
	{itemid = 11504, position = Position(33616,32721, 12)},
	{itemid = 11504, position = Position(33617,32719, 12)},
	{itemid = 11504, position = Position(33617,32717, 12)},
	{itemid = 414, position = Position(33612,32721, 12)},
	{itemid = 414, position = Position(33611,32713, 12)},
	{itemid = 414, position = Position(33624,32718, 12)},
	{itemid = 414, position = Position(33624,32717, 12)},
	{itemid = 414, position = Position(33611,32721, 12)},
	{itemid = 414, position = Position(33612,32723, 12)},
	{itemid = 414, position = Position(33612,32724, 12)},
	{itemid = 414, position = Position(33612,32720, 12)},
	{itemid = 414, position = Position(33612,32722, 12)},
	{itemid = 414, position = Position(33612,32719, 12)},
	{itemid = 414, position = Position(33625,32716, 12)},
	{itemid = 414, position = Position(33611,32720, 12)},
	{itemid = 414, position = Position(33611,32718, 12)},
	{itemid = 414, position = Position(33625,32717, 12)},
	{itemid = 414, position = Position(33625,32719, 12)},
	{itemid = 414, position = Position(33611,32719, 12)},
	{itemid = 414, position = Position(33612,32718, 12)},
	{itemid = 414, position = Position(33612,32712, 12)},
	{itemid = 414, position = Position(33612,32714, 12)},
	{itemid = 414, position = Position(33611,32723, 12)},
	{itemid = 414, position = Position(33612,32713, 12)},
	{itemid = 414, position = Position(33625,32718, 12)},
	{itemid = 414, position = Position(33611,32722, 12)},
	{itemid = 414, position = Position(33625,32720, 12)},
	{itemid = 414, position = Position(33619,32712, 12)},
	{itemid = 414, position = Position(33613,32713, 12)},
	{itemid = 414, position = Position(33620,32725, 12)},
	{itemid = 414, position = Position(33616,32727, 12)},
	{itemid = 414, position = Position(33620,32713, 12)},
	{itemid = 414, position = Position(33620,32726, 12)},
	{itemid = 414, position = Position(33615,32723, 12)},
	{itemid = 414, position = Position(33621,32712, 12)},
	{itemid = 414, position = Position(33621,32725, 12)},
	{itemid = 414, position = Position(33615,32715, 12)},
	{itemid = 414, position = Position(33620,32712, 12)},
	{itemid = 414, position = Position(33619,32727, 12)},
	{itemid = 414, position = Position(33618,32726, 12)},
	{itemid = 414, position = Position(33618,32727, 12)},
	{itemid = 414, position = Position(33617,32727, 12)},
	{itemid = 414, position = Position(33619,32725, 12)},
	{itemid = 414, position = Position(33618,32712, 12)},
	{itemid = 414, position = Position(33619,32726, 12)},
	{itemid = 414, position = Position(33613,32712, 12)},
	{itemid = 414, position = Position(33615,32714, 12)},
	{itemid = 414, position = Position(33619,32713, 12)},
	{itemid = 414, position = Position(33613,32722, 12)},
	{itemid = 414, position = Position(33613,32723, 12)},
	{itemid = 414, position = Position(33613,32724, 12)},
	{itemid = 414, position = Position(33613,32721, 12)},
	{itemid = 414, position = Position(33613,32715, 12)},
	{itemid = 414, position = Position(33613,32720, 12)},
	{itemid = 414, position = Position(33613,32714, 12)},
	{itemid = 414, position = Position(33622,32712, 12)},
	{itemid = 414, position = Position(33613,32725, 12)},
	{itemid = 414, position = Position(33614,32714, 12)},
	{itemid = 414, position = Position(33614,32723, 12)},
	{itemid = 414, position = Position(33614,32724, 12)},
	{itemid = 414, position = Position(33614,32713, 12)},
	{itemid = 414, position = Position(33614,32722, 12)},
	{itemid = 414, position = Position(33614,32715, 12)},
	{itemid = 414, position = Position(33614,32721, 12)},
	{itemid = 414, position = Position(33611,32712, 12)}
}
local function transformArea()
	for x = 33611, 33625 do
		for y = 32712, 32727 do
			local position = Position(x, y, 12)
			local tile = Tile(position)
			if not tile then
				return
			end
			local ground = tile:getGround()
			if not ground then
				return
			end
			local grounds = ground:getId()
			local items = tile:getItems()
			if items then
				for i = 1, #items do
					local item = items[i]
					if item then
						item:remove()
					end
				end
			end
			ground:remove()
		end
	end
	for i = 1, #corrupted do
		local item = corrupted[i]
		local ground = Tile(item.position):getGround()
		local transformid = item.itemid
		local tp = Game.createItem(item.itemid, 1, item.position)
	end
	return true
end

local ferumbrasAscendantHabitatCorrupted = Action()
function ferumbrasAscendantHabitatCorrupted.onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if item.itemid == 10044 then
		if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Corrupted) >= 1 then
			player:say('The lever are stucke, need some time to it can be moveable again.', TALKTYPE_MONSTER_SAY)
			return true
		end
		Game.createMonster('lovely yielothax', Position(33619, 32722, 12), true, true)
		addEvent(transformArea, 2 * 1000)
		item:transform(10045)
		local basin = Tile(Position(33628, 32721, 12)):getItemById(12070)
		if basin then
			basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA)
			basin:transform(24852)
		end
		Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Corrupted, 1)
		Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats, Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) + 1)
		player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'The room transforms into a completely different landscape.')
		if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.AllHabitats) >= 8 then
			addEvent(functionRevert, 1 * 60 * 60 * 1000)
		end
	elseif item.itemid == 10045 then
		item:transform(10044)
	end
	return true
end

ferumbrasAscendantHabitatCorrupted:aid(34311)
ferumbrasAscendantHabitatCorrupted:register()