local corrupted = {
	{itemid = 10796, position = Position(33614,32724, 12)},
	{itemid = 10796, position = Position(33620,32713, 12)},
	{itemid = 10796, position = Position(33619,32727, 12)},
	{itemid = 10796, position = Position(33615,32715, 12)},
	{itemid = 10796, position = Position(33622,32712, 12)},
	{itemid = 10796, position = Position(33620,32726, 12)},
	{itemid = 10795, position = Position(33613,32715, 12)},
	{itemid = 10795, position = Position(33618,32712, 12)},
	{itemid = 10795, position = Position(33613,32725, 12)},
	{itemid = 10795, position = Position(33624,32718, 12)},
	{itemid = 10795, position = Position(33612,32714, 12)},
	{itemid = 10795, position = Position(33612,32724, 12)},
	{itemid = 10795, position = Position(33619,32713, 12)},
	{itemid = 10794, position = Position(33615,32723, 12)},
	{itemid = 10794, position = Position(33612,32718, 12)},
	{itemid = 10794, position = Position(33613,32720, 12)},
	{itemid = 10794, position = Position(33614,32721, 12)},
	{itemid = 10794, position = Position(33621,32725, 12)},
	{itemid = 10794, position = Position(33615,32714, 12)},
	{itemid = 10794, position = Position(33614,32713, 12)},
	{itemid = 10793, position = Position(33624,32717, 12)},
	{itemid = 10793, position = Position(33625,32716, 12)},
	{itemid = 10793, position = Position(33618,32726, 12)},
	{itemid = 10793, position = Position(33616,32727, 12)},
	{itemid = 10793, position = Position(33619,32725, 12)},
	{itemid = 10792, position = Position(33614,32723, 12)},
	{itemid = 10792, position = Position(33613,32724, 12)},
	{itemid = 10792, position = Position(33619,32726, 12)},
	{itemid = 10792, position = Position(33620,32725, 12)},
	{itemid = 10792, position = Position(33620,32712, 12)},
	{itemid = 10791, position = Position(33613,32714, 12)},
	{itemid = 10791, position = Position(33619,32712, 12)},
	{itemid = 10791, position = Position(33613,32724, 12)},
	{itemid = 10791, position = Position(33612,32713, 12)},
	{itemid = 10791, position = Position(33612,32723, 12)},
	{itemid = 10790, position = Position(33614,32714, 12)},
	{itemid = 10790, position = Position(33614,32723, 12)},
	{itemid = 10790, position = Position(33612,32720, 12)},
	{itemid = 10790, position = Position(33613,32721, 12)},
	{itemid = 10790, position = Position(33613,32713, 12)},
	{itemid = 10789, position = Position(33618,32727, 12)},
	{itemid = 10789, position = Position(33619,32726, 12)},
	{itemid = 10789, position = Position(33625,32717, 12)},
	{itemid = 10787, position = Position(33621,32725, 12)},
	{itemid = 10787, position = Position(33621,32712, 12)},
	{itemid = 10787, position = Position(33615,32723, 12)},
	{itemid = 10787, position = Position(33611,32713, 12)},
	{itemid = 10787, position = Position(33611,32723, 12)},
	{itemid = 10787, position = Position(33614,32715, 12)},
	{itemid = 10786, position = Position(33614,32722, 12)},
	{itemid = 10786, position = Position(33613,32725, 12)},
	{itemid = 10786, position = Position(33612,32719, 12)},
	{itemid = 10786, position = Position(33613,32712, 12)},
	{itemid = 10785, position = Position(33620,32725, 12)},
	{itemid = 10785, position = Position(33617,32727, 12)},
	{itemid = 10785, position = Position(33611,32718, 12)},
	{itemid = 10783, position = Position(33625,32720, 12)},
	{itemid = 10779, position = Position(33625,32718, 12)},
	{itemid = 10776, position = Position(33625,32719, 12)},
	{itemid = 10740, position = Position(33619,32724, 12)},
	{itemid = 10737, position = Position(33613,32722, 12)},
	{itemid = 10736, position = Position(33619,32721, 12)},
	{itemid = 10735, position = Position(33623,32720, 12)},
	{itemid = 10710, position = Position(33620,32723, 12)},
	{itemid = 10708, position = Position(33615,32719, 12)},
	{itemid = 10693, position = Position(33622,32720, 12)},
	{itemid = 10693, position = Position(33618,32716, 12)},
	{itemid = 10692, position = Position(33617,32717, 12)},
	{itemid = 10691, position = Position(33621,32721, 12)},
	{itemid = 10690, position = Position(33621,32712, 12)},
	{itemid = 10690, position = Position(33625,32718, 12)},
	{itemid = 10689, position = Position(33618,32726, 12)},
	{itemid = 10689, position = Position(33624,32717, 12)},
	{itemid = 10688, position = Position(33620,32712, 12)},
	{itemid = 10688, position = Position(33614,32713, 12)},
	{itemid = 10687, position = Position(33613,32724, 12)},
	{itemid = 10686, position = Position(33613,32714, 12)},
	{itemid = 10685, position = Position(33614,32724, 12)},
	{itemid = 10685, position = Position(33619,32726, 12)},
	{itemid = 10682, position = Position(33614,32715, 12)},
	{itemid = 10604, position = Position(33616,32722, 12)},
	{itemid = 10603, position = Position(33620,32721, 12)},
	{itemid = 10603, position = Position(33621,32720, 12)},
	{itemid = 10603, position = Position(33618,32722, 12)},
	{itemid = 10602, position = Position(33621,32717, 12)},
	{itemid = 10601, position = Position(33616,32719, 12)},
	{itemid = 10601, position = Position(33617,32718, 12)},
	{itemid = 10601, position = Position(33618,32717, 12)},
	{itemid = 10599, position = Position(33617,32719, 12)},
	{itemid = 10599, position = Position(33618,32718, 12)},
	{itemid = 10598, position = Position(33620,32720, 12)},
	{itemid = 10598, position = Position(33618,32721, 12)},
	{itemid = 10596, position = Position(33621,32719, 12)},
	{itemid = 10596, position = Position(33621,32718, 12)},
	{itemid = 10595, position = Position(33617,32722, 12)},
	{itemid = 10595, position = Position(33619,32721, 12)},
	{itemid = 10594, position = Position(33616,32721, 12)},
	{itemid = 10594, position = Position(33616,32720, 12)},
	{itemid = 10593, position = Position(33620,32717, 12)},
	{itemid = 10593, position = Position(33619,32717, 12)},
	{itemid = 10592, position = Position(33619, 32718, 12)},
	{itemid = 10592, position = Position(33620, 32718, 12)},
	{itemid = 10592, position = Position(33618, 32719, 12)},
	{itemid = 10592, position = Position(33619, 32719, 12)},
	{itemid = 10592, position = Position(33620, 32719, 12)},
	{itemid = 10592, position = Position(33617, 32720, 12)},
	{itemid = 10592, position = Position(33618, 32720, 12)},
	{itemid = 10592, position = Position(33619, 32720, 12)},
	{itemid = 10592, position = Position(33617, 32721, 12)},
	{itemid = 10548, position = Position(33619,32722, 12)},
	{itemid = 10548, position = Position(33621,32715, 12)},
	{itemid = 10548, position = Position(33619,32721, 12)},
	{itemid = 10548, position = Position(33620,32723, 12)},
	{itemid = 10548, position = Position(33621,32716, 12)},
	{itemid = 10548, position = Position(33621,32714, 12)},
	{itemid = 10548, position = Position(33619,32716, 12)},
	{itemid = 10548, position = Position(33619,32717, 12)},
	{itemid = 10548, position = Position(33619,32723, 12)},
	{itemid = 10548, position = Position(33619,32724, 12)},
	{itemid = 10548, position = Position(33620,32724, 12)},
	{itemid = 10548, position = Position(33620,32721, 12)},
	{itemid = 10548, position = Position(33620,32727, 12)},
	{itemid = 10548, position = Position(33620,32722, 12)},
	{itemid = 10548, position = Position(33621,32713, 12)},
	{itemid = 10548, position = Position(33620,32720, 12)},
	{itemid = 10548, position = Position(33620,32716, 12)},
	{itemid = 10548, position = Position(33620,32717, 12)},
	{itemid = 10548, position = Position(33620,32714, 12)},
	{itemid = 10548, position = Position(33621,32717, 12)},
	{itemid = 10548, position = Position(33620,32715, 12)},
	{itemid = 10548, position = Position(33625,32727, 12)},
	{itemid = 10548, position = Position(33621,32719, 12)},
	{itemid = 10548, position = Position(33624,32715, 12)},
	{itemid = 10548, position = Position(33624,32714, 12)},
	{itemid = 10548, position = Position(33624,32713, 12)},
	{itemid = 10548, position = Position(33624,32716, 12)},
	{itemid = 10548, position = Position(33624,32720, 12)},
	{itemid = 10548, position = Position(33624,32719, 12)},
	{itemid = 10548, position = Position(33624,32721, 12)},
	{itemid = 10548, position = Position(33624,32712, 12)},
	{itemid = 10548, position = Position(33623,32726, 12)},
	{itemid = 10548, position = Position(33623,32722, 12)},
	{itemid = 10548, position = Position(33623,32727, 12)},
	{itemid = 10548, position = Position(33623,32723, 12)},
	{itemid = 10548, position = Position(33623,32725, 12)},
	{itemid = 10548, position = Position(33623,32724, 12)},
	{itemid = 10548, position = Position(33623,32721, 12)},
	{itemid = 10548, position = Position(33624,32722, 12)},
	{itemid = 10548, position = Position(33624,32724, 12)},
	{itemid = 10548, position = Position(33625,32722, 12)},
	{itemid = 10548, position = Position(33625,32721, 12)},
	{itemid = 10548, position = Position(33625,32723, 12)},
	{itemid = 10548, position = Position(33625,32725, 12)},
	{itemid = 10548, position = Position(33625,32724, 12)},
	{itemid = 10548, position = Position(33624,32723, 12)},
	{itemid = 10548, position = Position(33625,32715, 12)},
	{itemid = 10548, position = Position(33625,32713, 12)},
	{itemid = 10548, position = Position(33624,32725, 12)},
	{itemid = 10548, position = Position(33625,32714, 12)},
	{itemid = 10548, position = Position(33624,32726, 12)},
	{itemid = 10548, position = Position(33625,32712, 12)},
	{itemid = 10548, position = Position(33624,32727, 12)},
	{itemid = 10548, position = Position(33621,32718, 12)},
	{itemid = 10548, position = Position(33623,32720, 12)},
	{itemid = 10548, position = Position(33623,32718, 12)},
	{itemid = 10548, position = Position(33622,32715, 12)},
	{itemid = 10548, position = Position(33622,32714, 12)},
	{itemid = 10548, position = Position(33622,32713, 12)},
	{itemid = 10548, position = Position(33622,32716, 12)},
	{itemid = 10548, position = Position(33622,32718, 12)},
	{itemid = 10548, position = Position(33622,32717, 12)},
	{itemid = 10548, position = Position(33619,32715, 12)},
	{itemid = 10548, position = Position(33621,32727, 12)},
	{itemid = 10548, position = Position(33621,32724, 12)},
	{itemid = 10548, position = Position(33621,32720, 12)},
	{itemid = 10548, position = Position(33621,32726, 12)},
	{itemid = 10548, position = Position(33621,32721, 12)},
	{itemid = 10548, position = Position(33621,32723, 12)},
	{itemid = 10548, position = Position(33621,32722, 12)},
	{itemid = 10548, position = Position(33623,32719, 12)},
	{itemid = 10548, position = Position(33622,32719, 12)},
	{itemid = 10548, position = Position(33622,32721, 12)},
	{itemid = 10548, position = Position(33623,32714, 12)},
	{itemid = 10548, position = Position(33623,32713, 12)},
	{itemid = 10548, position = Position(33623,32715, 12)},
	{itemid = 10548, position = Position(33623,32717, 12)},
	{itemid = 10548, position = Position(33623,32716, 12)},
	{itemid = 10548, position = Position(33622,32720, 12)},
	{itemid = 10548, position = Position(33623,32712, 12)},
	{itemid = 10548, position = Position(33622,32726, 12)},
	{itemid = 10548, position = Position(33622,32722, 12)},
	{itemid = 10548, position = Position(33622,32727, 12)},
	{itemid = 10548, position = Position(33622,32723, 12)},
	{itemid = 10548, position = Position(33622,32725, 12)},
	{itemid = 10548, position = Position(33622,32724, 12)},
	{itemid = 10548, position = Position(33619,32714, 12)},
	{itemid = 10548, position = Position(33618,32716, 12)},
	{itemid = 10548, position = Position(33614,32727, 12)},
	{itemid = 10548, position = Position(33615,32719, 12)},
	{itemid = 10548, position = Position(33615,32720, 12)},
	{itemid = 10548, position = Position(33615,32721, 12)},
	{itemid = 10548, position = Position(33615,32722, 12)},
	{itemid = 10548, position = Position(33615,32718, 12)},
	{itemid = 10548, position = Position(33615,32716, 12)},
	{itemid = 10548, position = Position(33615,32717, 12)},
	{itemid = 10548, position = Position(33611,32725, 12)},
	{itemid = 10548, position = Position(33611,32724, 12)},
	{itemid = 10548, position = Position(33615,32713, 12)},
	{itemid = 10548, position = Position(33615,32724, 12)},
	{itemid = 10548, position = Position(33615,32726, 12)},
	{itemid = 10548, position = Position(33616,32715, 12)},
	{itemid = 10548, position = Position(33616,32716, 12)},
	{itemid = 10548, position = Position(33616,32717, 12)},
	{itemid = 10548, position = Position(33615,32725, 12)},
	{itemid = 10548, position = Position(33616,32714, 12)},
	{itemid = 10548, position = Position(33612,32727, 12)},
	{itemid = 10548, position = Position(33616,32713, 12)},
	{itemid = 10548, position = Position(33615,32727, 12)},
	{itemid = 10548, position = Position(33616,32718, 12)},
	{itemid = 10548, position = Position(33615,32712, 12)},
	{itemid = 10548, position = Position(33614,32726, 12)},
	{itemid = 10548, position = Position(33613,32719, 12)},
	{itemid = 10548, position = Position(33613,32726, 12)},
	{itemid = 10548, position = Position(33613,32727, 12)},
	{itemid = 10548, position = Position(33614,32712, 12)},
	{itemid = 10548, position = Position(33613,32718, 12)},
	{itemid = 10548, position = Position(33613,32716, 12)},
	{itemid = 10548, position = Position(33613,32717, 12)},
	{itemid = 10548, position = Position(33612,32725, 12)},
	{itemid = 10548, position = Position(33611,32726, 12)},
	{itemid = 10548, position = Position(33612,32717, 12)},
	{itemid = 10548, position = Position(33612,32715, 12)},
	{itemid = 10548, position = Position(33614,32720, 12)},
	{itemid = 10548, position = Position(33611,32727, 12)},
	{itemid = 10548, position = Position(33614,32725, 12)},
	{itemid = 10548, position = Position(33612,32716, 12)},
	{itemid = 10548, position = Position(33614,32719, 12)},
	{itemid = 10548, position = Position(33614,32717, 12)},
	{itemid = 10548, position = Position(33614,32718, 12)},
	{itemid = 10548, position = Position(33614,32716, 12)},
	{itemid = 10548, position = Position(33616,32719, 12)},
	{itemid = 10548, position = Position(33616,32712, 12)},
	{itemid = 10548, position = Position(33616,32720, 12)},
	{itemid = 10548, position = Position(33611,32716, 12)},
	{itemid = 10548, position = Position(33618,32713, 12)},
	{itemid = 10548, position = Position(33618,32714, 12)},
	{itemid = 10548, position = Position(33618,32715, 12)},
	{itemid = 10548, position = Position(33611,32717, 12)},
	{itemid = 10548, position = Position(33617,32725, 12)},
	{itemid = 10548, position = Position(33617,32726, 12)},
	{itemid = 10548, position = Position(33617,32724, 12)},
	{itemid = 10548, position = Position(33617,32723, 12)},
	{itemid = 10548, position = Position(33611,32715, 12)},
	{itemid = 10548, position = Position(33618,32717, 12)},
	{itemid = 10548, position = Position(33618,32724, 12)},
	{itemid = 10548, position = Position(33618,32725, 12)},
	{itemid = 10548, position = Position(33611,32714, 12)},
	{itemid = 10548, position = Position(33625,32726, 12)},
	{itemid = 10548, position = Position(33618,32723, 12)},
	{itemid = 10548, position = Position(33618,32721, 12)},
	{itemid = 10548, position = Position(33618,32722, 12)},
	{itemid = 10548, position = Position(33618,32718, 12)},
	{itemid = 10548, position = Position(33617,32722, 12)},
	{itemid = 10548, position = Position(33612,32726, 12)},
	{itemid = 10548, position = Position(33616,32726, 12)},
	{itemid = 10548, position = Position(33616,32723, 12)},
	{itemid = 10548, position = Position(33617,32714, 12)},
	{itemid = 10548, position = Position(33617,32715, 12)},
	{itemid = 10548, position = Position(33617,32713, 12)},
	{itemid = 10548, position = Position(33616,32725, 12)},
	{itemid = 10548, position = Position(33617,32712, 12)},
	{itemid = 10548, position = Position(33616,32724, 12)},
	{itemid = 10548, position = Position(33616,32722, 12)},
	{itemid = 10548, position = Position(33617,32716, 12)},
	{itemid = 10548, position = Position(33617,32718, 12)},
	{itemid = 10548, position = Position(33616,32721, 12)},
	{itemid = 10548, position = Position(33617,32719, 12)},
	{itemid = 10548, position = Position(33617,32717, 12)},
	{itemid = 417, position = Position(33612,32721, 12)},
	{itemid = 417, position = Position(33611,32713, 12)},
	{itemid = 417, position = Position(33624,32718, 12)},
	{itemid = 417, position = Position(33624,32717, 12)},
	{itemid = 417, position = Position(33611,32721, 12)},
	{itemid = 417, position = Position(33612,32723, 12)},
	{itemid = 417, position = Position(33612,32724, 12)},
	{itemid = 417, position = Position(33612,32720, 12)},
	{itemid = 417, position = Position(33612,32722, 12)},
	{itemid = 417, position = Position(33612,32719, 12)},
	{itemid = 417, position = Position(33625,32716, 12)},
	{itemid = 417, position = Position(33611,32720, 12)},
	{itemid = 417, position = Position(33611,32718, 12)},
	{itemid = 417, position = Position(33625,32717, 12)},
	{itemid = 417, position = Position(33625,32719, 12)},
	{itemid = 417, position = Position(33611,32719, 12)},
	{itemid = 417, position = Position(33612,32718, 12)},
	{itemid = 417, position = Position(33612,32712, 12)},
	{itemid = 417, position = Position(33612,32714, 12)},
	{itemid = 417, position = Position(33611,32723, 12)},
	{itemid = 417, position = Position(33612,32713, 12)},
	{itemid = 417, position = Position(33625,32718, 12)},
	{itemid = 417, position = Position(33611,32722, 12)},
	{itemid = 417, position = Position(33625,32720, 12)},
	{itemid = 417, position = Position(33619,32712, 12)},
	{itemid = 417, position = Position(33613,32713, 12)},
	{itemid = 417, position = Position(33620,32725, 12)},
	{itemid = 417, position = Position(33616,32727, 12)},
	{itemid = 417, position = Position(33620,32713, 12)},
	{itemid = 417, position = Position(33620,32726, 12)},
	{itemid = 417, position = Position(33615,32723, 12)},
	{itemid = 417, position = Position(33621,32712, 12)},
	{itemid = 417, position = Position(33621,32725, 12)},
	{itemid = 417, position = Position(33615,32715, 12)},
	{itemid = 417, position = Position(33620,32712, 12)},
	{itemid = 417, position = Position(33619,32727, 12)},
	{itemid = 417, position = Position(33618,32726, 12)},
	{itemid = 417, position = Position(33618,32727, 12)},
	{itemid = 417, position = Position(33617,32727, 12)},
	{itemid = 417, position = Position(33619,32725, 12)},
	{itemid = 417, position = Position(33618,32712, 12)},
	{itemid = 417, position = Position(33619,32726, 12)},
	{itemid = 417, position = Position(33613,32712, 12)},
	{itemid = 417, position = Position(33615,32714, 12)},
	{itemid = 417, position = Position(33619,32713, 12)},
	{itemid = 417, position = Position(33613,32722, 12)},
	{itemid = 417, position = Position(33613,32723, 12)},
	{itemid = 417, position = Position(33613,32724, 12)},
	{itemid = 417, position = Position(33613,32721, 12)},
	{itemid = 417, position = Position(33613,32715, 12)},
	{itemid = 417, position = Position(33613,32720, 12)},
	{itemid = 417, position = Position(33613,32714, 12)},
	{itemid = 417, position = Position(33622,32712, 12)},
	{itemid = 417, position = Position(33613,32725, 12)},
	{itemid = 417, position = Position(33614,32714, 12)},
	{itemid = 417, position = Position(33614,32723, 12)},
	{itemid = 417, position = Position(33614,32724, 12)},
	{itemid = 417, position = Position(33614,32713, 12)},
	{itemid = 417, position = Position(33614,32722, 12)},
	{itemid = 417, position = Position(33614,32715, 12)},
	{itemid = 417, position = Position(33614,32721, 12)},
	{itemid = 417, 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 == 9125 then
		if Game.getStorageValue(GlobalStorage.FerumbrasAscendant.Habitats.Corrupted) >= 1 then
			player:say('The lever are stuck, 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(9126)
		local basin = Tile(Position(33628, 32721, 12)):getItemById(11114)
		if basin then
			basin:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA)
			basin:transform(22196)
		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 == 9126 then
		item:transform(9125)
	end
	return true
end

ferumbrasAscendantHabitatCorrupted:aid(34311)
ferumbrasAscendantHabitatCorrupted:register()