dofile('data/Scripts/Scenes/Common.lua');
dofile('data/Scripts/Scenes/Animations/21_Volcano_Animations.lua');
dofile('data/Scripts/Scenes/Animations/21_VolcanoMonster_Animations.lua');

------------------------------------------------------------------------------
--
function OnSceneLoad(restoringFromSave)
	InitGameState();

	play_field = playField;
    LoadData();
	play_field = nil;

    RootZoomZone = CreateZoomZone('RootZoomZone', nil, 
                                   nil, 0.0, 
                                   nil, 0.0,
							{'RootBackground',
							 'actZoneBox',

							 'acacia',
							 'amphora',
							 'arrowhead',
							 'basRelief',
							 'bat',
							 'bucket',
							 'butterfly',
							 'camomile',
							 'caterpillar',
							 'centipede',
							 'dinosaur1',
							 'dinosaur2',
							 'drum',
							 'flower',
							 'frogStatuette',
							 'hammer',
							 'handbell',
							 'hook',
							 'indianJug',
							 'ladder',
							 'lizard',
							 'manStatue1',
							 'manStatue2',
							 'mask',
							 'orchid',
							 'paddle',
							 'plane',
							 'plant',
							 'ruby',
							 'scorpion',
							 'seahorse',
							 'skull1',
							 'skull2',
							 'snail',
							 'spider',
							 'statue',
							 'statuette',
							 'tortoise1',
							 'tortoise2',
							 'warriorHead',
							 'womanStatue',

							 'box',
							 'boxCracked',
							 'chestBottom',
							 'chestTopClosed',
							 'chestTopOpened',

							 'LayerOver1',
							 'LayerOver2',
							 'LayerOverAcacia',
							 'LayerOverCamomile',
							 'LayerOverManStatue2',
							 'LayerOverTortoise2',
							 'LayerOverWomanStatue',
							 'LayerOverBook',

							 'Boards',
							 'Book',
							 'Crowbar',
							 'Key',
							 'Lantern',
							 'Boards_onPlace',
							 'Lantern_onPlace',
							 'Rope_onPlace',

							 'actZoneBridge',
							 'actZoneLantern',
							 'actZoneChest'},

							{'Boards_onPlace',
							 'Lantern_onPlace',
							 'Rope_onPlace'},

							{'LanterGlow'});

    BoxZoomZone = CreateZoomZone('BoxZoomZone', RootZoomZone, 
                                   'actZoneBox', 0.0, 
                                   nil, 0.0,
							{'ZoomBoxBackground',
							 'layerOverCrack',
							 'Rope',

							 'actZoneBoxBoards'},

							{'Rope'});

if (restoringFromSave == false) then
    AddRandomTasks(true, MISC_TASK_COUNT_24,
		CreateTask('acacia'),
		CreateTask('amphora'),
		CreateTask('arrowhead'),
		CreateTask('basRelief'),
		CreateTask('bat'),
		CreateTask('bucket'),
		CreateTask('butterfly'),
		CreateTask('camomile'),
		CreateTask('caterpillar'),
		CreateTask('centipede'),
		CreateTask('dinosaur1'),
		CreateTask('dinosaur2'),
		CreateTask('drum'),
		CreateTask('flower'),
		CreateTask('frogStatuette'),
		CreateTask('hammer'),
		CreateTask('handbell'),
		CreateTask('hook'),
		CreateTask('indianJug'),
		CreateTask('ladder'),
		CreateTask('lizard'),
		CreateTask('manStatue1'),
		CreateTask('manStatue2'),
		CreateTask('mask'),
		CreateTask('orchid'),
		CreateTask('paddle'),
		CreateTask('plane'),
		CreateTask('plant'),
		CreateTask('ruby'),
		CreateTask('scorpion'),
		CreateTask('seahorse'),
		CreateTask('skull1'),
		CreateTask('skull2'),
		CreateTask('snail'),
		CreateTask('spider'),
		CreateTask('statue'),
		CreateTask('statuette'),
		CreateTask('tortoise1'),
		CreateTask('tortoise2'),
		CreateTask('warriorHead'),
		CreateTask('womanStatue')
	);

    playField:GetLevelScreen():AddTaskSafe(CreateTask('Boards'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Book'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Crowbar'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Key'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Lantern'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Rope'));
end

	CreateToolMap(	{'Boards',		'actZoneBridge'},
					{'Book',		''},
					{'Crowbar',		'actZoneBoxBoards'},
					{'Key',   		'actZoneChest'},
					{'Lantern', 	'actZoneLantern'},
					{'Rope',		'actZoneBridge'});

	SetIconForGameObject(playField:GetObject('acacia'),		'data/Texture/Scenes/21_Volcano/Items/Misc/acacia_icon.png');
	SetIconForGameObject(playField:GetObject('amphora'),	'data/Texture/Scenes/21_Volcano/Items/Misc/amphora_icon.png');
	SetIconForGameObject(playField:GetObject('arrowhead'),	'data/Texture/Scenes/21_Volcano/Items/Misc/arrowhead_icon.png');
	SetIconForGameObject(playField:GetObject('basRelief'),	'data/Texture/Scenes/21_Volcano/Items/Misc/basRelief_icon.png');
	SetIconForGameObject(playField:GetObject('bat'),		'data/Texture/Scenes/21_Volcano/Items/Misc/bat_icon.png');
	SetIconForGameObject(playField:GetObject('bucket'),		'data/Texture/Scenes/21_Volcano/Items/Misc/bucket_icon.png');
	SetIconForGameObject(playField:GetObject('butterfly'),	'data/Texture/Scenes/21_Volcano/Items/Misc/butterfly_icon.png');
	SetIconForGameObject(playField:GetObject('camomile'),	'data/Texture/Scenes/21_Volcano/Items/Misc/camomile_icon.png');
	SetIconForGameObject(playField:GetObject('caterpillar'),'data/Texture/Scenes/21_Volcano/Items/Misc/caterpillar_icon.png');
	SetIconForGameObject(playField:GetObject('centipede'),	'data/Texture/Scenes/21_Volcano/Items/Misc/centipede_icon.png');
	SetIconForGameObject(playField:GetObject('dinosaur1'),	'data/Texture/Scenes/21_Volcano/Items/Misc/dinosaur1_icon.png');
	SetIconForGameObject(playField:GetObject('dinosaur2'),	'data/Texture/Scenes/21_Volcano/Items/Misc/dinosaur2_icon.png');
	SetIconForGameObject(playField:GetObject('drum'),		'data/Texture/Scenes/21_Volcano/Items/Misc/drum_icon.png');
	SetIconForGameObject(playField:GetObject('flower'),		'data/Texture/Scenes/21_Volcano/Items/Misc/flower_icon.png');
	SetIconForGameObject(playField:GetObject('frogStatuette'),'data/Texture/Scenes/21_Volcano/Items/Misc/frogStatuette_icon.png');
	SetIconForGameObject(playField:GetObject('hammer'),		'data/Texture/Scenes/21_Volcano/Items/Misc/hammer_icon.png');
	SetIconForGameObject(playField:GetObject('handbell'),	'data/Texture/Scenes/21_Volcano/Items/Misc/handbell_icon.png');
	SetIconForGameObject(playField:GetObject('hook'),		'data/Texture/Scenes/21_Volcano/Items/Misc/hook_icon.png');
	SetIconForGameObject(playField:GetObject('indianJug'),	'data/Texture/Scenes/21_Volcano/Items/Misc/indianJug_icon.png');
	SetIconForGameObject(playField:GetObject('ladder'),		'data/Texture/Scenes/21_Volcano/Items/Misc/ladder_icon.png');
	SetIconForGameObject(playField:GetObject('lizard'),		'data/Texture/Scenes/21_Volcano/Items/Misc/lizard_icon.png');
	SetIconForGameObject(playField:GetObject('manStatue1'),	'data/Texture/Scenes/21_Volcano/Items/Misc/manStatue1_icon.png');
	SetIconForGameObject(playField:GetObject('manStatue2'),	'data/Texture/Scenes/21_Volcano/Items/Misc/manStatue2_icon.png');
	SetIconForGameObject(playField:GetObject('mask'),		'data/Texture/Scenes/21_Volcano/Items/Misc/mask_icon.png');
	SetIconForGameObject(playField:GetObject('orchid'),		'data/Texture/Scenes/21_Volcano/Items/Misc/orchid_icon.png');
	SetIconForGameObject(playField:GetObject('paddle'),		'data/Texture/Scenes/21_Volcano/Items/Misc/paddle_icon.png');
	SetIconForGameObject(playField:GetObject('plane'),		'data/Texture/Scenes/21_Volcano/Items/Misc/plane_icon.png');
	SetIconForGameObject(playField:GetObject('plant'),		'data/Texture/Scenes/21_Volcano/Items/Misc/plant_icon.png');
	SetIconForGameObject(playField:GetObject('ruby'),		'data/Texture/Scenes/21_Volcano/Items/Misc/ruby_icon.png');
	SetIconForGameObject(playField:GetObject('scorpion'),	'data/Texture/Scenes/21_Volcano/Items/Misc/scorpion_icon.png');
	SetIconForGameObject(playField:GetObject('seahorse'),	'data/Texture/Scenes/21_Volcano/Items/Misc/seahorse_icon.png');
	SetIconForGameObject(playField:GetObject('skull1'),		'data/Texture/Scenes/21_Volcano/Items/Misc/skull1_icon.png');
	SetIconForGameObject(playField:GetObject('skull2'),		'data/Texture/Scenes/21_Volcano/Items/Misc/skull2_icon.png');
	SetIconForGameObject(playField:GetObject('snail'),		'data/Texture/Scenes/21_Volcano/Items/Misc/snail_icon.png');
	SetIconForGameObject(playField:GetObject('spider'),		'data/Texture/Scenes/21_Volcano/Items/Misc/spider_icon.png');
	SetIconForGameObject(playField:GetObject('statue'),		'data/Texture/Scenes/21_Volcano/Items/Misc/statue_icon.png');
	SetIconForGameObject(playField:GetObject('statuette'),	'data/Texture/Scenes/21_Volcano/Items/Misc/statuette_icon.png');
	SetIconForGameObject(playField:GetObject('tortoise1'),	'data/Texture/Scenes/21_Volcano/Items/Misc/tortoise1_icon.png');
	SetIconForGameObject(playField:GetObject('tortoise2'),	'data/Texture/Scenes/21_Volcano/Items/Misc/tortoise2_icon.png');
	SetIconForGameObject(playField:GetObject('warriorHead'),'data/Texture/Scenes/21_Volcano/Items/Misc/warriorHead_icon.png');
	SetIconForGameObject(playField:GetObject('womanStatue'),'data/Texture/Scenes/21_Volcano/Items/Misc/womanStatue_icon.png');

	SetIconForGameObject(playField:GetObject('Boards'),		'data/Texture/Scenes/21_Volcano/Items/Boards_icon.png');
	SetIconForGameObject(playField:GetObject('Book'),		'data/Texture/Scenes/21_Volcano/Items/Book_icon.png');
	SetIconForGameObject(playField:GetObject('Crowbar'),	'data/Texture/Scenes/21_Volcano/Items/Crowbar_icon.png');
	SetIconForGameObject(playField:GetObject('Key'),		'data/Texture/Scenes/21_Volcano/Items/Key_icon.png');
	SetIconForGameObject(playField:GetObject('Lantern'),	'data/Texture/Scenes/21_Volcano/Items/Lantern_icon.png');
	SetIconForGameObject(playField:GetObject('Rope'),		'data/Texture/Scenes/21_Volcano/Items/Rope_icon.png');

if (restoringFromSave == false) then
	gameState.finalZoomInPos = {SCREEN_WIDTH/2.0, SCREEN_HEIGHT/2.0 + 200.0};

	gameState.boardsOnPlace = false;
	gameState.bookFound = false;
	gameState.crowbarUsed = false;
	gameState.keyUsed = false;
	gameState.lanternOnPlace = false;
	gameState.ropeOnPlace = false;

	gameState.ropeFound = false;

	gameState.allToolsApplied = false;
	gameState.levelCompleted = false;
end

	AssignActiveZonesGlow({function() return gameState.boardsOnPlace; end,		'actZoneBridge',	'Boards_ghost'},
						  {function() return gameState.crowbarUsed; end,		'actZoneBoxBoards',	'Crowbar_ghost'},
					      {function() return gameState.keyUsed; end,			'actZoneChest',		'Key_ghost'},
						  {function() return gameState.lanternOnPlace; end,		'actZoneLantern',	'Lantern_ghost'},
						  {function() return gameState.ropeOnPlace; end,		'actZoneBridge',	'Rope_ghost'});

    ApplyLevelDump(restoringFromSave);
	SetZoneVisible(RootZoomZone, true, false);

	auxSceneInit(restoringFromSave);
	auxProcessToolObjectStateAnCursorType();
end

------------------------------------------------------------------------------
--
function OnSceneFree()
    FreeData()

	StopSound('L21S10');
	StopSound('L21S11');
	StopSound('L21S12');
	StopSound('L21S13');
end

--// Local auxiliary functions - - - - - - - - - - - - - - - - - - - - - - - -
function auxSceneInit(restoringFromSave)
    local initialActions = function()
		ShowLevelIntro(21);
    end
	local regularActions = function()
		PlaySound('L21S10', true);

--		gameState.customCursors['actZoneBox'] = {'CursorZoom'};

		playField:IgnoreOnTestPoint('LanterGlow');

		playField:IgnoreOnTestPoint('LayerOver1');
		playField:IgnoreOnTestPoint('LayerOver2');
		playField:IgnoreOnTestPoint('LayerOverAcacia');
		playField:IgnoreOnTestPoint('LayerOverCamomile');
		playField:IgnoreOnTestPoint('LayerOverManStatue2');
		playField:IgnoreOnTestPoint('LayerOverTortoise2');
		playField:IgnoreOnTestPoint('LayerOverWomanStatue');

		auxCreateVolcanoEnvAnimations(playField:GetObject('RootBackground'));
		auxPlayVolcanoEnvAnimation('FrontEnv');
--		auxPlayVolcanoEnvAnimation('LanternLight'); 

		auxCreateVolcanoMonsterAnimations(playField:GetObject('RootBackground'));
		auxPlayVolcanoMonsterAnimation('LayerOver');
--		auxPlayVolcanoMonsterAnimation('MonsterIdle2');
		auxPlayVolcanoMonsterAnimation('MonsterIdle1'); 

		gameState.monsterIdle1InitPosY = auxGetVolcanoMonsterAnimation('MonsterIdle1'):GetY();
		gameState.monsterIdle1Shift = 100.0;
		gameState.monsterIdle1IsMoving = false;
		gameState.monsterAnimationDelay = 10.0;
	end

    if (restoringFromSave == false) then
        initialActions();
	else
    end	
    regularActions();

	if (gameState.levelCompleted == true) then
		gameState.levelCompleted = false;
		auxTestLevelCompleteCondition();
	end
end

function auxProcessToolObjectStateAnCursorType()
    assert(	gameState.boardsOnPlace ~= nil and
			gameState.bookFound ~= nil and
			gameState.crowbarUsed ~= nil and
			gameState.keyUsed ~= nil and
			gameState.lanternOnPlace ~= nil and
			gameState.ropeOnPlace ~= nil and

			gameState.allToolsApplied ~= nil and
			gameState.levelCompleted ~= nil);

	if (gameState.boardsOnPlace == true) then
		RootZoomZone.UnhideObject('Boards_onPlace');
	else
		RootZoomZone.HideObject('Boards_onPlace');
	end
	if (gameState.ropeOnPlace == true) then
		RootZoomZone.UnhideObject('Rope_onPlace');
	else
		RootZoomZone.HideObject('Rope_onPlace');
	end
	if (gameState.boardsOnPlace == true and gameState.ropeOnPlace == true) then
		gameState.customCursors['actZoneBridge'] = nil;
	else
		gameState.customCursors['actZoneBridge'] = {'CursorArms'};
	end

	if (gameState.lanternOnPlace == true) then
		RootZoomZone.UnhideObject('Lantern_onPlace');
		gameState.customCursors['actZoneLantern'] = nil;
		if (auxGetVolcanoEnvAnimation('LanternLight'):IsVisible() == false) then
			auxPlayVolcanoEnvAnimation('LanternLight');
		end
	else
		RootZoomZone.HideObject('Lantern_onPlace');
		gameState.customCursors['actZoneLantern'] = {'CursorArms'};
		if (auxGetVolcanoEnvAnimation('LanternLight'):IsVisible() == true) then
			auxHideVolcanoEnvAnimation('LanternLight');
		end
	end
	auxUpdateMonterState();
	playField:GetObject('LanterGlow'):SetVisible(gameState.lanternOnPlace);

	if (gameState.keyUsed == true) then
		RootZoomZone.HideObject('chestTopClosed');
		RootZoomZone.UnhideObject('chestTopOpened');
		gameState.customCursors['actZoneChest'] = nil;
	else
		RootZoomZone.UnhideObject('chestTopClosed');
		RootZoomZone.HideObject('chestTopOpened');
		gameState.customCursors['actZoneChest'] = {'CursorArms'};
	end
	playField:GetObject('actZoneChest'):SetVisible(not gameState.keyUsed);

	if (gameState.crowbarUsed == true) then
		BoxZoomZone.HideObject('layerOverCrack');
		if (playField:HasObject('Rope') == true) then
			BoxZoomZone.UnhideObject('Rope');
		end
		gameState.customCursors['actZoneBoxBoards'] = nil;
	else
		BoxZoomZone.UnhideObject('layerOverCrack');
		if (playField:HasObject('Rope') == true) then
			BoxZoomZone.HideObject('Rope');
		end
		gameState.customCursors['actZoneBoxBoards'] = {'CursorArms'};
	end
	playField:GetObject('actZoneBoxBoards'):SetVisible(not gameState.crowbarUsed);

	if (gameState.ropeFound == false) then
		gameState.customCursors['actZoneBox'] = {'CursorZoom'};
		gameState.lockedObjects['actZoneBox'] = nil;
	else
		gameState.customCursors['actZoneBox'] = nil;
		gameState.lockedObjects['actZoneBox'] = true;
	end
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxHideMonster()
	local duration = 1.0;

	gameState.monsterIdle1IsMoving = true;
	TimerDoString('SetGameStateParameter(\'monsterIdle1IsMoving\', false);', duration, playField:GetTimer());

	do
		local compositionName = 'MonsterIdle2';
		local composition = auxGetVolcanoMonsterAnimation(compositionName);

		if (composition ~= nil and composition:IsPaused() == true) then
			local messageDelay = 5.0;

			auxPlayVolcanoMonsterAnimation('MonsterIdle2');
			TimerDoString('playField:GetLevelScreen():ShowTip(GetTextString(\'LEVEL21_LANTERN_ON_PLACE\'));', messageDelay, playField:GetTimer()); 
		else
			playField:GetLevelScreen():ShowTip(GetTextString('LEVEL21_LANTERN_ON_PLACE'));
		end
	end

	local composition = auxGetVolcanoMonsterAnimation('MonsterIdle1');
	composition:SetY(gameState.monsterIdle1InitPosY);
	do
		local y = composition:GetY();
	    local eff = CreateAnimationEffector();
	    eff:AttachTo(composition);
	    eff:SetKey(_TRACK_Y, 0.0, 		y);
	    eff:SetKey(_TRACK_Y, duration, 	y + gameState.monsterIdle1Shift);
	    eff:Play();
--		composition:Move(0.0, gameState.monsterIdle1Shift, duration);	
	end
end
function auxUpdateMonterState()
	if (gameState.monsterIdle1IsMoving == false) then
		local composition = auxGetVolcanoMonsterAnimation('MonsterIdle1');

		if (gameState.lanternOnPlace == true) then
			composition:SetY(gameState.monsterIdle1InitPosY + gameState.monsterIdle1Shift);
		else
			composition:SetY(gameState.monsterIdle1InitPosY);
		end
	end
end
--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxUpdatePeriodicAnimations(dt)
	if (gameState.monsterAnimationDelay == 0.0) then
		local compositionName = 'MonsterIdle2';
		local composition = auxGetVolcanoMonsterAnimation(compositionName);

		if (composition ~= nil and composition:IsPaused() == true and
			gameState.lanternOnPlace == false) then
			PlaySound('L21S11');
			auxPlayVolcanoMonsterAnimation(compositionName);
		end
		gameState.monsterAnimationDelay = math.random(10, 20);
	else
		gameState.monsterAnimationDelay = (gameState.monsterAnimationDelay - dt >= 0.0 and gameState.monsterAnimationDelay - dt or 0.0);
	end
end


--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxTestLevelCompleteCondition()
	if (
		gameState.allToolsApplied == true and
		gameState.levelCompleted == false and
		playField:GetLevelScreen():HasUncompletedTask() == false) then

		gameState.levelCompleted = true;
		TimerDoString('OnWin();', 2.0, playField:GetTimer());
	end
end
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

------------------------------------------------------------------------------
--
function OnDialogButtonPress(name, param)
end

------------------------------------------------------------------------------
--
function OnUpdate(dt)
    DefaultOnUpdate(dt);
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	auxUpdatePeriodicAnimations(dt);
end

------------------------------------------------------------------------------
--
function OnWin()
	DefaultOnWin();
end

------------------------------------------------------------------------------
--
function OnObjectMouseEnter(object)
    local objectName = object:GetName();

    DefaultOnObjectMouseEnter(object);
	ActivateActiveZoneGlow(objectName);
end

------------------------------------------------------------------------------
--
function OnObjectMouseLeave(object)
    local objectName = object:GetName();

    DefaultOnObjectMouseLeave(object);
    DeactivateActiveZoneGlow(objectName);
end

------------------------------------------------------------------------------
--
function OnObjectMouseDown(object)
    local objectName = object:GetName();
    local isWrongClick = true;

	assert(gameState.activeZone ~= nil and gameState.locker:GetNReferences() > 0);

    if (gameState.lockedObjects[objectName] ~= true) then
        if (gameState.activeZone.HasObject(objectName)) then
            isWrongClick = DefaultOnZoomZoneActiveObjectClick(objectName);

			--// ...

	        if (isWrongClick == true and playField:GetLevelScreen():IsTaskObject(objectName)) then
	            auxAttachInPlace(object, playField);
				object:ResetClippingRect();
				--// remove object from zoom-zone which contents it
				assert(gameState.activeZone.objects[objectName] ~= nil);
				gameState.activeZone.objects[objectName] = nil;

                playField:OnObjectFound(object);
                isWrongClick = false;
            end
        else
--			assert(gameState.activeZone ~= RootZoomZone and 
--				   gameState.locker:GetNReferences() > 1 and
--				   'Attempt to close root scene - you have clicked on an object which hasn`t been added to any zoom-zone');
            if (gameState.activeZone ~= RootZoomZone and gameState.locker:GetNReferences() > 1) then
                if (gameState.lockedObjects[gameState.activeZone.activeObject] == nil) then
                    SetZoneVisible(gameState.activeZone, false);
                end
            else
                Log('Lua: OnObjectMouseDown(\''..objectName..'\'): Was made click on object which hasn`t been attached to any zoom-zone');
            end
        end --// if (gameState.activeZone.HasObject(...
    end --// if (gameState.lockedObjects[...

	--// Tips - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
	if (objectName == 'actZoneBoxBoards' and gameState.crowbarUsed == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL21_CROWBAR_TIP1'));
	elseif (objectName == 'actZoneBridge' and (gameState.boardsOnPlace == false or gameState.ropeOnPlace == false)) then
		if (gameState.boardsOnPlace == false and gameState.ropeOnPlace == false) then
		    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL21_BRIDGE_BOARDS_TIP1'),
											   GetTextString('LEVEL21_BRIDGE_ROPE_TIP1'));
		elseif (gameState.boardsOnPlace == false) then
		    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL21_BRIDGE_BOARDS_TIP1'));
		else
		    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL21_BRIDGE_ROPE_TIP1'));
		end
	elseif (objectName == 'actZoneLantern' and gameState.lanternOnPlace == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL21_LANTERN_TIP1'));
	elseif (objectName == 'actZoneChest' and gameState.keyUsed == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL21_KEY_TIP1'));
	else
	    playField:GetLevelScreen():HideTip();
	end
	--//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

    DefaultOnObjectClick(object, isWrongClick, not playField:GetLevelScreen():IsTipShown());
    DefaultOnObjectMouseEnter(object);
end

------------------------------------------------------------------------------
--
function OnObjectMouseUp(object)
end

------------------------------------------------------------------------------
--
function OnObjectFound(object)
    local objectName = object:GetName();
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    assert(gameState.activeZone ~= nil);
    if (gameState.activeZone == BoxZoomZone and objectName == 'Rope') then
		gameState.ropeFound = true;
		CloseAndBlockActiveZone();
    end
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	local objectMustBeHighlighted = DefaultOnObjectFound(object);
	return objectMustBeHighlighted;
end

------------------------------------------------------------------------------
--
function OnToolFound(tool)
end

------------------------------------------------------------------------------
--
function CanToolBeApplied(tool, object)
	local toolName = tool:GetName();
	local objName = object:GetName();
    local canToolBeApplied = true;
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	canToolBeApplied = DefaultCanToolBeApplied(tool, object);
	return canToolBeApplied;
end

------------------------------------------------------------------------------
--
function OnToolApply(tool, object)
	local toolName = tool:GetName();
	local objName = object:GetName();
    local toolApplied = false;

	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	if (toolName == 'Boards' and objName == gameState.toolMap[toolName]) then
		gameState.boardsOnPlace = true;
		toolApplied = true;
	end
	if (toolName == 'Book') then
		gameState.bookFound = true;
		toolApplied = true;
	end
	if (toolName == 'Crowbar' and objName == gameState.toolMap[toolName]) then
		gameState.crowbarUsed = true;
		toolApplied = true;
		PlaySound('L21S12');
	end
	if (toolName == 'Key' and objName == gameState.toolMap[toolName]) then
		gameState.keyUsed = true;
		toolApplied = true;
		PlaySound('L21S13');
	end
	if (toolName == 'Lantern' and objName == gameState.toolMap[toolName]) then
		gameState.lanternOnPlace = true;
		toolApplied = true;
		auxHideMonster();
	end
	if (toolName == 'Rope' and objName == gameState.toolMap[toolName]) then
		gameState.ropeOnPlace = true;
		toolApplied = true;
	end
	if (not toolApplied) then
	    playField:GetLevelScreen():ShowTip(GetTextString('WRONG_ITEM_APPLIED_TIP1'),
										   GetTextString('WRONG_ITEM_APPLIED_TIP2'));
	end

	if (gameState.boardsOnPlace == true and
		gameState.bookFound == true and
		gameState.crowbarUsed == true and
		gameState.keyUsed == true and
		gameState.lanternOnPlace == true and
		gameState.ropeOnPlace == true and
		gameState.allToolsApplied == false) then

		gameState.allToolsApplied = true;
		if (playField:GetLevelScreen():HasUncompletedTask() == true) then
		    playField:GetLevelScreen():ShowTip(GetTextString('HAVE_TO_FIND_ITEMS_MSG1'),
											   GetTextString('HAVE_TO_FIND_ITEMS_MSG2'));
		else
			auxTestLevelCompleteCondition();
		end
	end

	auxProcessToolObjectStateAnCursorType();
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    DefaultOnObjectMouseEnter(object);
	if (toolApplied == true) then
	    DeactivateActiveZoneDeactivatedGlow(object:GetName());
	end
	return toolApplied;
end

------------------------------------------------------------------------------
--
function OnObjectReachPanel(object)
    local objectName = object:GetName();
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	if objectName == 'Book' then
		playField:ApplyTool(object, object);
        playField:GetLevelScreen():RunMiniGame('data/Scripts/Minigames/MapPazzle.lua');
	end

	auxTestLevelCompleteCondition();
end

------------------------------------------------------------------------------
--
function OnButtonPress(zoneName)
    DefaultOnButtonPress(zoneName);
end

------------------------------------------------------------------------------
--
function OnMouseMove(prevMousePos, currentMousePos)
end

------------------------------------------------------------------------------
--
function OnSetTool(tool)
end

------------------------------------------------------------------------------
-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function LoadData()
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/background.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('RootBackground',anim,512,384,98,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/acacia.png',0,0,90,106,1,0)
	anim:SetHotSpot(45,53)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('acacia',anim,218,433,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/amphora.png',0,0,59,81,1,0)
	anim:SetHotSpot(29,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('amphora',anim,837,562,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/arrowhead.png',0,0,44,93,1,0)
	anim:SetHotSpot(22,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('arrowhead',anim,351,150,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/basRelief.png',0,0,83,109,1,0)
	anim:SetHotSpot(41,54)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('basRelief',anim,709,164,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/bat.png',0,0,86,91,1,0)
	anim:SetHotSpot(43,45)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('bat',anim,158,128,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/bucket.png',0,0,94,92,1,0)
	anim:SetHotSpot(47,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('bucket',anim,409,726,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/butterfly.png',0,0,72,62,1,0)
	anim:SetHotSpot(36,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('butterfly',anim,965,531,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/camomile.png',0,0,58,103,1,0)
	anim:SetHotSpot(29,51)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('camomile',anim,463,707,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/caterpillar.png',0,0,29,69,1,0)
	anim:SetHotSpot(14,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('caterpillar',anim,744,630,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/centipede.png',0,0,50,76,1,0)
	anim:SetHotSpot(25,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('centipede',anim,849,71,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/dinosaur1.png',0,0,130,80,1,0)
	anim:SetHotSpot(65,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('dinosaur1',anim,269,86,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/dinosaur2.png',0,0,105,94,1,0)
	anim:SetHotSpot(52,47)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('dinosaur2',anim,796,333,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/drum.png',0,0,69,102,1,0)
	anim:SetHotSpot(34,51)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('drum',anim,469,670,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/flower.png',0,0,59,58,1,0)
	anim:SetHotSpot(29,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('flower',anim,251,578,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/frogStatuette.png',0,0,57,85,1,0)
	anim:SetHotSpot(28,42)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('frogStatuette',anim,362,512,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/hammer.png',0,0,120,60,1,0)
	anim:SetHotSpot(60,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('hammer',anim,621,707,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/handbell.png',0,0,73,76,1,0)
	anim:SetHotSpot(36,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('handbell',anim,950,723,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/hook.png',0,0,75,65,1,0)
	anim:SetHotSpot(37,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('hook',anim,709,720,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/indianJug.png',0,0,92,99,1,0)
	anim:SetHotSpot(46,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('indianJug',anim,322,649,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/ladder.png',0,0,54,192,1,0)
	anim:SetHotSpot(27,96)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('ladder',anim,434,477,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/lizard.png',0,0,85,117,1,0)
	anim:SetHotSpot(42,58)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('lizard',anim,824,180,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/manStatue1.png',0,0,89,109,1,0)
	anim:SetHotSpot(44,54)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('manStatue1',anim,252,207,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/manStatue2.png',0,0,94,120,1,0)
	anim:SetHotSpot(47,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('manStatue2',anim,794,481,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/mask.png',0,0,50,89,1,0)
	anim:SetHotSpot(25,44)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mask',anim,526,250,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/orchid.png',0,0,79,89,1,0)
	anim:SetHotSpot(39,44)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('orchid',anim,968,236,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/paddle.png',0,0,49,135,1,0)
	anim:SetHotSpot(24,67)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('paddle',anim,319,532,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/plane.png',0,0,81,64,1,0)
	anim:SetHotSpot(40,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('plane',anim,836,735,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/plant.png',0,0,71,106,1,0)
	anim:SetHotSpot(35,53)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('plant',anim,843,632,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/ruby.png',0,0,33,32,1,0)
	anim:SetHotSpot(16,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('ruby',anim,879,413,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/scorpion.png',0,0,80,65,1,0)
	anim:SetHotSpot(40,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('scorpion',anim,408,641,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/seahorse.png',0,0,53,101,1,0)
	anim:SetHotSpot(26,50)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('seahorse',anim,971,395,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/skull1.png',0,0,74,97,1,0)
	anim:SetHotSpot(37,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('skull1',anim,147,454,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/skull2.png',0,0,75,60,1,0)
	anim:SetHotSpot(37,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('skull2',anim,352,334,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/snail.png',0,0,63,66,1,0)
	anim:SetHotSpot(31,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('snail',anim,977,297,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/spider.png',0,0,64,103,1,0)
	anim:SetHotSpot(32,51)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('spider',anim,429,281,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/statue.png',0,0,52,176,1,0)
	anim:SetHotSpot(26,88)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('statue',anim,642,353,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/statuette.png',0,0,51,75,1,0)
	anim:SetHotSpot(25,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('statuette',anim,472,89,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/tortoise1.png',0,0,58,79,1,0)
	anim:SetHotSpot(29,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('tortoise1',anim,160,310,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/tortoise2.png',0,0,79,53,1,0)
	anim:SetHotSpot(39,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('tortoise2',anim,423,367,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/warriorHead.png',0,0,62,99,1,0)
	anim:SetHotSpot(31,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('warriorHead',anim,799,680,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Misc/womanStatue.png',0,0,45,162,1,0)
	anim:SetHotSpot(22,81)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('womanStatue',anim,557,482,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/box.png',0,0,90,54,1,0)
	anim:SetHotSpot(45,27)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('box',anim,411,593,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/boxCracked.png',0,0,88,49,1,0)
	anim:SetHotSpot(44,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('boxCracked',anim,410,594,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/LayerOver1.png',0,0,124,63,1,0)
	anim:SetHotSpot(62,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOver1',anim,263,702,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/LayerOver2.png',0,0,63,152,1,0)
	anim:SetHotSpot(31,76)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOver2',anim,916,690,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/LayerOverAcacia.png',0,0,34,86,1,0)
	anim:SetHotSpot(17,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverAcacia',anim,177,412,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/LayerOverCamomile.png',0,0,30,22,1,0)
	anim:SetHotSpot(15,11)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverCamomile',anim,451,756,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/LayerOverManStatue2.png',0,0,68,114,1,0)
	anim:SetHotSpot(34,57)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverManStatue2',anim,815,493,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/LayerOverTortoise2.png',0,0,49,56,1,0)
	anim:SetHotSpot(24,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverTortoise2',anim,400,357,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/LayerOverWomanStatue.png',0,0,50,51,1,0)
	anim:SetHotSpot(25,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverWomanStatue',anim,552,545,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/radialGlow.png',0,0,97,99,1,0)
	anim:SetHotSpot(48,48)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFF8800')
	play_field:CreateObject('LanterGlow',anim,521,561,105,0,3,2.6)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Boards.png',0,0,106,52,1,0)
	anim:SetHotSpot(53,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Boards',anim,303,700,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Boards_onPlace.png',0,0,93,36,1,0)
	anim:SetHotSpot(46,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Boards_onPlace',anim,591,642,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/chestBottom.png',0,0,116,90,1,0)
	anim:SetHotSpot(58,45)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('chestBottom',anim,512,760,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/LayerOverBook.png',0,0,100,74,1,0)
	anim:SetHotSpot(50,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverBook',anim,510,767,107,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/chestTopClosed.png',0,0,114,64,1,0)
	anim:SetHotSpot(57,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('chestTopClosed',anim,514,734,108,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Layers/chestTopOpened.png',0,0,94,90,1,0)
	anim:SetHotSpot(47,45)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('chestTopOpened',anim,497,706,109,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Book.png',0,0,80,60,1,0)
	anim:SetHotSpot(40,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Book',anim,516,746,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Crowbar.png',0,0,49,148,1,0)
	anim:SetHotSpot(24,74)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Crowbar',anim,913,687,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Key.png',0,0,92,64,1,0)
	anim:SetHotSpot(46,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Key',anim,979,47,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Lantern.png',0,0,45,76,1,0)
	anim:SetHotSpot(22,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Lantern',anim,876,651,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Lantern_onPlace.png',0,0,39,72,1,0)
	anim:SetHotSpot(19,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Lantern_onPlace',anim,522,565,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Rope_onPlace.png',0,0,91,66,1,0)
	anim:SetHotSpot(45,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Rope_onPlace',anim,597,641,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZoneBridge',anim,629,626,102,0,1.3,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZoneLantern',anim,517,571,106,0,0.75,0.85)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZoneChest',anim,514,759,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZoneBox',anim,400,585,102,0,1,0.7)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Zones/Box/Layers/background.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('ZoomBoxBackground',anim,614,449,200,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Zones/Box/Layers/layerOverCrack.png',0,0,320,228,1,0)
	anim:SetHotSpot(160,114)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('layerOverCrack',anim,642,443,204,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Rope.png',0,0,114,90,1,0)
	anim:SetHotSpot(57,45)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	play_field:CreateObject('Rope',anim,629,438,203,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/actZoneC.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	play_field:CreateObject('actZoneBoxBoards',anim,629,423,206,0,2,2)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Boards_ghost.png',0,0,96,64,1,0)
	anim:SetHotSpot(48,32)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Boards_ghost',anim,585,640,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Key_ghost.png',0,0,80,65,1,0)
	anim:SetHotSpot(40,40)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Key_ghost',anim,548,735,112,0,-1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Lantern_ghost.png',0,0,60,84,1,0)
	anim:SetHotSpot(30,42)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Lantern_ghost',anim,522,565,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Rope_ghost.png',0,0,84,96,1,0)
	anim:SetHotSpot(42,48)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Rope_ghost',anim,659,613,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/21_Volcano/Items/Crowbar_ghost.png',0,0,96,96,1,0)
	anim:SetHotSpot(48,48)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Crowbar_ghost',anim,672,438,210,0,1.5,1.5)
end

function FreeData()
end
-- CLEAR_ON_SAVE_END
