dofile('data/Scripts/Scenes/Common.lua');
dofile('data/Scripts/Scenes/Animations/12_ShamansHut_Animations.lua');

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

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

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

							 'amphora',
							 'amulet',
							 'basket',
							 'bucket',
							 'bug',
							 'butterfly',
							 'cat',
							 'cinnamon',
							 'corn',
							 'crane',
							 'cuirass',
							 'dice',
							 'drum',
							 'duck',
							 'fish',
							 'grapes',
							 'hammer',
							 'horn',
							 'knife',
							 'leaves',
							 'leopardLeg',
							 'lizard',
							 'maraca',
							 'mortar',
							 'nuts',
							 'pineapple',
							 'pink',
							 'pomegranate',
							 'ring',
							 'sabre',
							 'scalp',
							 'scorpion',
							 'spider',
							 'statuette',
							 'stone',
							 'tambourine',
							 'watermelon',
							 'wing',
							 'wreath',
							 'xylophone',

							 'LayerOverAmphora',
							 'LayerOverCat',
							 'LayerOverCinnamon',
							 'LayerOverCorn',
							 'LayerOverGrapes',
							 'LayerOverGuard',
							 'LayerOverMagicSphere',
							 'LayerOverMaraca',
							 'LayerOverNuts',
							 'LayerOverPineapple',
							 'LayerOverSabre',
							 'LayerOverScalp',
							 'LayerOverWing',
							 'LayerOverWreath',
							 'magicSphere',
							 'potWaterPlane',
							 'pot',
							 'mechanismRope',
							 'mechanismWheel',
							 'potBoilingWaterAnim',

							 'Basin',
							 'Flint',
							 'Handle',
							 'Herb',
							 'Jar',
							 'Rag',
							 'Handle_onPlace',
							 'Rag_onPlace',

							 'actZonePot',
							 'actZoneEmbers',
							 'actZoneHandle'},

							{'Handle_onPlace',
							 'Rag_onPlace'},

							{'entranceLight',
							 'embersGlow1',
							 'embersGlow2'});

if (restoringFromSave == false) then
    AddRandomTasks(true, MISC_TASK_COUNT_24,
		CreateTask('amphora'),
		CreateTask('amulet'),
		CreateTask('basket'),
		CreateTask('bucket'),
		CreateTask('bug'),
		CreateTask('butterfly'),
		CreateTask('cat'),
		CreateTask('cinnamon'),
		CreateTask('corn'),
		CreateTask('crane'),
		CreateTask('cuirass'),
		CreateTask('dice'),
		CreateTask('drum'),
		CreateTask('duck'),
		CreateTask('fish'),
		CreateTask('grapes'),
		CreateTask('hammer'),
		CreateTask('horn'),
		CreateTask('knife'),
		CreateTask('leaves'),
		CreateTask('leopardLeg'),
		CreateTask('lizard'),
		CreateTask('maraca'),
		CreateTask('mortar'),
		CreateTask('nuts'),
		CreateTask('pineapple'),
		CreateTask('pink'),
		CreateTask('pomegranate'),
		CreateTask('ring'),
		CreateTask('sabre'),
		CreateTask('scalp'),
		CreateTask('scorpion'),
		CreateTask('spider'),
		CreateTask('statuette'),
		CreateTask('stone'),
		CreateTask('tambourine'),
		CreateTask('watermelon'),
		CreateTask('wing'),
		CreateTask('wreath'),
		CreateTask('xylophone')
	);

    playField:GetLevelScreen():AddTaskSafe(CreateTask('Rag'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Herb'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Jar'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Basin'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Handle'));
    playField:GetLevelScreen():AddTaskSafe(CreateTask('Flint'));
end

	CreateToolMap(	{'Rag', 		'actZonePot'},
					{'Herb',   		'actZonePot'},
					{'Jar',			'actZonePot'},
					{'Basin',   	'actZonePot'},
					{'Handle',  	'actZoneHandle'},
					{'Flint',		'actZoneEmbers'});

	SetIconForGameObject(playField:GetObject('amphora'),	'data/Texture/Scenes/12_ShamansHut/Items/Misc/amphora_icon.png');
	SetIconForGameObject(playField:GetObject('amulet'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/amulet_icon.png');
	SetIconForGameObject(playField:GetObject('basket'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/basket_icon.png');
	SetIconForGameObject(playField:GetObject('bucket'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/bucket_icon.png');
	SetIconForGameObject(playField:GetObject('bug'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/bug_icon.png');
	SetIconForGameObject(playField:GetObject('butterfly'),	'data/Texture/Scenes/12_ShamansHut/Items/Misc/butterfly_icon.png');
	SetIconForGameObject(playField:GetObject('cat'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/cat_icon.png');
	SetIconForGameObject(playField:GetObject('cinnamon'),	'data/Texture/Scenes/12_ShamansHut/Items/Misc/cinnamon_icon.png');
	SetIconForGameObject(playField:GetObject('corn'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/corn_icon.png');
	SetIconForGameObject(playField:GetObject('crane'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/crane_icon.png');
	SetIconForGameObject(playField:GetObject('cuirass'),	'data/Texture/Scenes/12_ShamansHut/Items/Misc/cuirass_icon.png');
	SetIconForGameObject(playField:GetObject('dice'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/dice_icon.png');
	SetIconForGameObject(playField:GetObject('drum'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/drum_icon.png');
	SetIconForGameObject(playField:GetObject('duck'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/duck_icon.png');
	SetIconForGameObject(playField:GetObject('fish'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/fish_icon.png');
	SetIconForGameObject(playField:GetObject('grapes'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/grapes_icon.png');
	SetIconForGameObject(playField:GetObject('hammer'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/hammer_icon.png');
	SetIconForGameObject(playField:GetObject('horn'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/horn_icon.png');
	SetIconForGameObject(playField:GetObject('knife'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/knife_icon.png');
	SetIconForGameObject(playField:GetObject('leaves'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/leaves_icon.png');
	SetIconForGameObject(playField:GetObject('leopardLeg'),	'data/Texture/Scenes/12_ShamansHut/Items/Misc/leopardLeg_icon.png');
	SetIconForGameObject(playField:GetObject('lizard'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/lizard_icon.png');
	SetIconForGameObject(playField:GetObject('maraca'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/maraca_icon.png');
	SetIconForGameObject(playField:GetObject('mortar'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/mortar_icon.png');
	SetIconForGameObject(playField:GetObject('nuts'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/nuts_icon.png');
	SetIconForGameObject(playField:GetObject('pineapple'),	'data/Texture/Scenes/12_ShamansHut/Items/Misc/pineapple_icon.png');
	SetIconForGameObject(playField:GetObject('pink'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/pink_icon.png');
	SetIconForGameObject(playField:GetObject('pomegranate'),'data/Texture/Scenes/12_ShamansHut/Items/Misc/pomegranate_icon.png');
	SetIconForGameObject(playField:GetObject('ring'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/ring_icon.png');
	SetIconForGameObject(playField:GetObject('sabre'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/sabre_icon.png');
	SetIconForGameObject(playField:GetObject('scalp'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/scalp_icon.png');
	SetIconForGameObject(playField:GetObject('scorpion'),	'data/Texture/Scenes/12_ShamansHut/Items/Misc/scorpion_icon.png');
	SetIconForGameObject(playField:GetObject('spider'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/spider_icon.png');
	SetIconForGameObject(playField:GetObject('statuette'),	'data/Texture/Scenes/12_ShamansHut/Items/Misc/statuette_icon.png');
	SetIconForGameObject(playField:GetObject('stone'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/stone_icon.png');
	SetIconForGameObject(playField:GetObject('tambourine'),	'data/Texture/Scenes/12_ShamansHut/Items/Misc/tambourine_icon.png');
	SetIconForGameObject(playField:GetObject('watermelon'),	'data/Texture/Scenes/12_ShamansHut/Items/Misc/watermelon_icon.png');
	SetIconForGameObject(playField:GetObject('wing'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/wing_icon.png');
	SetIconForGameObject(playField:GetObject('wreath'),		'data/Texture/Scenes/12_ShamansHut/Items/Misc/wreath_icon.png');
	SetIconForGameObject(playField:GetObject('xylophone'),	'data/Texture/Scenes/12_ShamansHut/Items/Misc/xylophone_icon.png');

	SetIconForGameObject(playField:GetObject('Rag'),	'data/Texture/Scenes/12_ShamansHut/Items/Rag_icon.png');
	SetIconForGameObject(playField:GetObject('Herb'),	'data/Texture/Scenes/12_ShamansHut/Items/Herb_icon.png');
	SetIconForGameObject(playField:GetObject('Jar'),	'data/Texture/Scenes/12_ShamansHut/Items/Jar_icon.png');
	SetIconForGameObject(playField:GetObject('Basin'),	'data/Texture/Scenes/12_ShamansHut/Items/Basin_icon.png');
	SetIconForGameObject(playField:GetObject('Handle'),	'data/Texture/Scenes/12_ShamansHut/Items/Handle_icon.png');
	SetIconForGameObject(playField:GetObject('Flint'),	'data/Texture/Scenes/12_ShamansHut/Items/Flint_icon.png');


if (restoringFromSave == false) then
	gameState.ragInitPosX = playField:GetObject('Rag_onPlace'):GetX();
	gameState.ragMoveDistance = 365.0;

	gameState.ragUsed = false;
	gameState.herbUsed = false;
	gameState.jarUsed = false;
	gameState.basinUsed = false;
	gameState.handleOnPlace = false;
	gameState.flintUsed = false;

	gameState.steamEnabled = false;
	gameState.mechanismIsOn = false;
	gameState.mechanismActivated = false;
	gameState.guardIsSleeping = false;

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

	AssignActiveZonesGlow({function() return gameState.ragUsed or
											 not gameState.herbUsed or
											 not gameState.jarUsed or
											 not gameState.basinUsed or
											 not gameState.flintUsed; end,	'actZonePot',		'Rag_ghost'},
						  {function() return gameState.herbUsed; end,		'actZonePot',		'Herb_ghost'},
					      {function() return gameState.jarUsed; end,		'actZonePot',		'Jar_ghost'},
						  {function() return gameState.basinUsed; end,		'actZonePot',		'Basin_ghost'},
						  {function() return gameState.handleOnPlace; end,	'actZoneHandle',	'Handle_ghost'},
						  {function() return gameState.flintUsed; end,		'actZoneEmbers',	'Flint_ghost'});


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

	auxSceneInit(restoringFromSave);
	auxProcessToolObjectStateAnCursorType();
end

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

    StopSound('L12S10');
    StopSound('L12S11');
    StopSound('L12S12');
end

--// Local auxiliary functions - - - - - - - - - - - - - - - - - - - - - - - -
function auxSceneInit(restoringFromSave)
    local initialActions = function()
		ShowLevelIntro(12);
    end
	local regularActions = function()
-- (!) The entrance door light already exists in the environmental animation
--	    playField:IgnoreOnTestPoint('entranceLight');
--		playField:GetObject('entranceLight'):SetZ(15);
--		auxSetFibrillationEffector(playField:GetObject('entranceLight'), 0.42, 1.35);

		auxSetFibrillationEffector(playField:GetObject('embersGlow1'), 0.08, 0.35);
		auxSetFibrillationEffector(playField:GetObject('embersGlow2'), 0.12, 0.28);

	    playField:IgnoreOnTestPoint('magicSphereGlow1');
	    playField:IgnoreOnTestPoint('magicSphereGlow2');
		auxSetFibrillationEffector(playField:GetObject('magicSphereGlow2'), 0.95, 2.0);
		auxSetLevitationEffector(playField:GetObject('magicSphere'), {0.0, 20.0}, {0.0, 4.35});
		auxAttachInPlace(playField:GetObject('magicSphereGlow1'), playField:GetObject('magicSphere'));
		auxAttachInPlace(playField:GetObject('magicSphereGlow2'), playField:GetObject('magicSphere'));

		auxCreateShamansHutAnimations(playField:GetObject('RootBackground'));
--		auxPlayShamansHutAnimation('GuardianSleep');
		auxPlayShamansHutAnimation('GuardianIdle');

		auxPlayShamansHutAnimation('EnvTop');
		auxPlayShamansHutAnimation('Fly1');
--		auxPlayShamansHutAnimation('Fly2');
--		auxPlayShamansHutAnimation('Spider2');

		gameState.nextAnimationDelay = 0;

		gameState.steamEnabled = false;
	end

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

	if (gameState.mechanismActivated --[[and 
		gameState.levelCompleted == true]]) then

        gameState.guardIsSleeping = true;
		gameState.levelCompleted = false;
		auxTestLevelCompleteCondition();
	end
end


function auxProcessToolObjectStateAnCursorType()
    assert(	gameState.ragUsed ~= nil and
			gameState.herbUsed ~= nil and
			gameState.jarUsed ~= nil and
			gameState.basinUsed ~= nil and
			gameState.handleOnPlace ~= nil and
			gameState.flintUsed ~= nil);

	if (gameState.ragUsed == true and gameState.herbUsed == true and gameState.jarUsed == true and gameState.basinUsed == true) then
		gameState.customCursors['actZonePot'] = nil;		
	else
		gameState.customCursors['actZonePot'] = {'CursorArms'};
	end

	if (gameState.basinUsed == true) then
		RootZoomZone.UnhideObject('potWaterPlane');
	else
		RootZoomZone.HideObject('potWaterPlane');
	end

	if (gameState.flintUsed == true) then
		if (gameState.basinUsed == true) then
			RootZoomZone.UnhideObject('potBoilingWaterAnim');
			auxEnableBoilingVatEffects();
			RootZoomZone.HideObject('potWaterPlane');
		end
		gameState.customCursors['actZoneEmbers'] = nil;
	else
		RootZoomZone.HideObject('potBoilingWaterAnim');
		gameState.customCursors['actZoneEmbers'] = {'CursorArms'};
	end
	playField:GetObject('embersGlow1'):SetVisible(gameState.flintUsed == true);
	playField:GetObject('embersGlow2'):SetVisible(gameState.flintUsed == true);

	if (gameState.handleOnPlace == true) then
		RootZoomZone.UnhideObject('Handle_onPlace');
		if (gameState.mechanismIsOn == false) then
			if (gameState.mechanismActivated == true) then
				gameState.customCursors['actZoneHandle'] = nil;
				playField:GetObject('Rag_onPlace'):SetX(gameState.ragInitPosX + gameState.ragMoveDistance);
				auxHideShamansHutAnimation('GuardianIdle');
				auxHideShamansHutAnimation('GuardianSleep');
			else
				playField:GetObject('Rag_onPlace'):SetX(gameState.ragInitPosX);
				gameState.customCursors['actZoneHandle'] = {'CursorArms'};
			end
		end
	else
		RootZoomZone.HideObject('Handle_onPlace');
		gameState.customCursors['actZoneHandle'] = {'CursorArms'};
	end

	if (gameState.ragUsed == true) then
		RootZoomZone.UnhideObject('Rag_onPlace');
	else
		RootZoomZone.HideObject('Rag_onPlace');
	end
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxSleepGuardian()
	if (gameState.guardIsSleeping == false) then
		gameState.guardIsSleeping = true;

		PlaySound('L12S12');
		auxHideShamansHutAnimation('GuardianIdle');
		auxPlayShamansHutAnimation('GuardianSleep');
		auxTestLevelCompleteCondition();
	end
end
function auxDisableStateFlag(flagName, additinalAction)
	assert(gameState[flagName] ~= nil);
	gameState[flagName] = false;
	if (additinalAction ~= nil) then
		additinalAction();
	end
end
function auxTurnMechanismHandle()
	local duration = 3.0;
	local smallWheelRadius, bigWheelRadius = 25.0, 50.0;
	local smallWheelTurns, bigWheelTurns = gameState.ragMoveDistance/smallWheelRadius, 
										   gameState.ragMoveDistance/bigWheelRadius;

	PlaySound('L12S11');
	gameState.mechanismActivated = true;
	gameState.mechanismIsOn = true;
	TimerDoString('auxDisableStateFlag(\'mechanismIsOn\');', duration, playField:GetTimer());

	playField:GetObject('Rag_onPlace'):SetX(gameState.ragInitPosX);

	playField:GetObject('Handle_onPlace'):Rotate(-smallWheelTurns, 0.75*duration);
	playField:GetObject('mechanismWheel'):Rotate(-bigWheelTurns, 0.75*duration);
	playField:GetObject('Rag_onPlace'):Move(gameState.ragMoveDistance, 0.0, 0.75*duration);
	TimerDoString('auxSleepGuardian();', duration, playField:GetTimer());

	gameState.customCursors['actZoneHandle'] = nil;
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxEnableBoilingVatEffects()
	if (gameState.steamEnabled == false) then
		gameState.steamEnabled = true;

	    PlaySound('L12S10', true);

		local steamPS = CreateParticleSystemEntity('data/ParticleSystem/LightSmoke.psi', 'LightSmokeParticle');
		steamPS:AttachTo(playField);
		steamPS:SetXY(350.0, 600.0);	
		steamPS:SetZ(1000.0);
		steamPS:SetScale(1.0);
		steamPS:SetGeneration(true);
		steamPS:AffectedByParentAngleAndScale(true);

		local x = steamPS:GetX();
		local duration = 0.06;
	   	local eff = CreateAnimationEffector();
	   	eff:AttachTo(steamPS);
	   	eff:SetMode(_ANIM_LOOP + _ANIM_PINGPONG);

	   	eff:SetKey(_TRACK_X, 0.0,      x + 15.0);
	   	eff:SetKey(_TRACK_X, duration, x - 15.0);
	   	eff:Play();
	end
end


--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxUpdatePeriodicAnimations(dt)
	if (gameState.nextAnimationDelay == 0.0) then
		local animations = {};

		for compositionName, composition in pairs(shamansHutCompositions) do
			if (composition:IsCyclic() == false and
				composition:GetName() ~= 'GuardianSleep' and composition:GetName() ~= 'GuardianIdle') then
				table.insert(animations, composition:GetName());
			end
		end

		local animName = animations[math.random(1, table.getn(animations))];
		if (animName ~= nil) then
			local composition = auxGetShamansHutAnimation(animName);

            if (composition ~= nil and composition:IsPaused() == true) then
				auxPlayShamansHutAnimation(animName);
			end
		end
		gameState.nextAnimationDelay = math.random(4, 11);
	else
		gameState.nextAnimationDelay = (gameState.nextAnimationDelay - dt >= 0.0 and gameState.nextAnimationDelay - dt or 0.0);
	end
end

--// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function auxTestLevelCompleteCondition()
	if (gameState.mechanismActivated == true and
		gameState.guardIsSleeping == true and

		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 (objectName == 'actZoneHandle' and gameState.mechanismActivated == false) then
				if (gameState.handleOnPlace == true and gameState.ragUsed == true) then
					gameState.mechanismActivated = true;
gameState.levelCompleted = true;
					auxTurnMechanismHandle();
	                isWrongClick = false;
				else
				end
			end

	        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 == 'actZonePot' and
		(gameState.basinUsed == false or gameState.herbUsed == false or gameState.jarUsed == false or gameState.ragUsed == false)) then

		if (gameState.basinUsed == false or gameState.herbUsed == false or gameState.jarUsed == false) then
			local uncompleted = {};
			table.insert(uncompleted, gameState.basinUsed == false and 1 or nil);
			table.insert(uncompleted, gameState.herbUsed == false and 2 or nil);
			table.insert(uncompleted, gameState.jarUsed == false and 3 or nil);

			if (table.getn(uncompleted) > 0) then
				local tipIndex = math.random(1, table.getn(uncompleted));
				if (    uncompleted[tipIndex] == 1 and gameState.basinUsed == false) then
				    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL12_POT_WATER_TIP1'));
				elseif (uncompleted[tipIndex] == 2 and gameState.herbUsed == false) then
				    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL12_POT_HERBS_TIP1'));
				elseif (uncompleted[tipIndex] == 3 and gameState.jarUsed == false) then
				    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL12_POT_SPICY_TIP1'));
				end
			end
		elseif (gameState.ragUsed == false) then
		    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL12_POT_RUG_TIP1'));
		end
	elseif (objectName == 'actZoneEmbers' and gameState.flintUsed == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL12_FLINT_TIP1'));
	elseif (objectName == 'actZoneHandle' and gameState.handleOnPlace == false) then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL12_HANDLE_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();
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	if (objectName == 'Herb') then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL12_HERB_FOUND_TIP'));
	elseif (objectName == 'Rag') then
	    playField:GetLevelScreen():ShowTip(GetTextString('LEVEL12_RAG_ON_PLACE_TIP'));
	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 == 'Rag' and objName == gameState.toolMap[toolName]) then
		if (gameState.herbUsed == true and gameState.jarUsed ==true and gameState.basinUsed == true and gameState.flintUsed == true) then
	    	gameState.ragUsed = true;
			toolApplied = true;
		else
			playField:GetLevelScreen():ShowTip(GetTextString('CANNT_USE_ITEM_YET_TIP1'), 
											   GetTextString('CANNT_USE_ITEM_YET_TIP2'));
			return;
		end
	end
	if (toolName == 'Herb' and objName == gameState.toolMap[toolName]) then
    	gameState.herbUsed = true;
		toolApplied = true;
	end
	if (toolName == 'Jar' and objName == gameState.toolMap[toolName]) then
    	gameState.jarUsed = true;
		toolApplied = true;
	end
	if (toolName == 'Basin' and objName == gameState.toolMap[toolName]) then
    	gameState.basinUsed = true;
		toolApplied = true;
	end
	if (toolName == 'Handle' and objName == gameState.toolMap[toolName]) then
    	gameState.handleOnPlace = true;
		toolApplied = true;
	end
	if (toolName == 'Flint' and objName == gameState.toolMap[toolName]) then
    	gameState.flintUsed = true;
		toolApplied = true;
	end
	if (not toolApplied) then
	    playField:GetLevelScreen():ShowTip(GetTextString('WRONG_ITEM_APPLIED_TIP1'),
										   GetTextString('WRONG_ITEM_APPLIED_TIP2'));
	end

	if (gameState.ragUsed == true and
    	gameState.herbUsed == true and
    	gameState.jarUsed == true and
    	gameState.basinUsed == true and
    	gameState.handleOnPlace == true and
    	gameState.flintUsed == 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();
	-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	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/12_ShamansHut/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/12_ShamansHut/Items/Misc/amphora.png',0,0,245,226,1,0)
	anim:SetHotSpot(122,113)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('amphora',anim,899,543,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/amulet.png',0,0,166,205,1,0)
	anim:SetHotSpot(83,102)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('amulet',anim,774,351,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/basket.png',0,0,153,130,1,0)
	anim:SetHotSpot(76,65)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('basket',anim,442,705,108,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/bucket.png',0,0,284,239,1,0)
	anim:SetHotSpot(142,119)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('bucket',anim,149,638,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/bug.png',0,0,100,93,1,0)
	anim:SetHotSpot(50,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('bug',anim,128,125,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/butterfly.png',0,0,150,121,1,0)
	anim:SetHotSpot(75,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('butterfly',anim,484,72,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/cat.png',0,0,142,149,1,0)
	anim:SetHotSpot(71,74)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('cat',anim,316,430,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/cinnamon.png',0,0,136,95,1,0)
	anim:SetHotSpot(68,47)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('cinnamon',anim,216,420,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/corn.png',0,0,168,200,1,0)
	anim:SetHotSpot(84,100)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('corn',anim,332,286,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/crane.png',0,0,274,261,1,0)
	anim:SetHotSpot(137,130)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('crane',anim,443,586,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/cuirass.png',0,0,205,215,1,0)
	anim:SetHotSpot(102,107)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('cuirass',anim,403,506,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/dice.png',0,0,142,83,1,0)
	anim:SetHotSpot(71,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('dice',anim,950,680,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/drum.png',0,0,216,172,1,0)
	anim:SetHotSpot(108,86)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('drum',anim,513,541,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/duck.png',0,0,148,135,1,0)
	anim:SetHotSpot(74,67)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('duck',anim,724,499,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/fish.png',0,0,148,150,1,0)
	anim:SetHotSpot(74,75)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('fish',anim,721,128,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/grapes.png',0,0,156,83,1,0)
	anim:SetHotSpot(78,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('grapes',anim,171,436,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/hammer.png',0,0,178,190,1,0)
	anim:SetHotSpot(89,95)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('hammer',anim,674,558,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/horn.png',0,0,157,108,1,0)
	anim:SetHotSpot(78,54)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('horn',anim,307,174,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/knife.png',0,0,249,118,1,0)
	anim:SetHotSpot(124,59)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('knife',anim,620,636,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/leaves.png',0,0,171,147,1,0)
	anim:SetHotSpot(85,73)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('leaves',anim,533,565,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/leopardLeg.png',0,0,142,175,1,0)
	anim:SetHotSpot(71,87)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('leopardLeg',anim,142,490,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/lizard.png',0,0,229,243,1,0)
	anim:SetHotSpot(114,121)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('lizard',anim,912,391,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/maraca.png',0,0,146,114,1,0)
	anim:SetHotSpot(73,57)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('maraca',anim,580,709,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/mortar.png',0,0,169,120,1,0)
	anim:SetHotSpot(84,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mortar',anim,236,706,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/nuts.png',0,0,181,177,1,0)
	anim:SetHotSpot(90,88)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('nuts',anim,547,693,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/pineapple.png',0,0,160,157,1,0)
	anim:SetHotSpot(80,78)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('pineapple',anim,160,254,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/pink.png',0,0,207,147,1,0)
	anim:SetHotSpot(103,73)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('pink',anim,186,276,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/pomegranate.png',0,0,89,95,1,0)
	anim:SetHotSpot(44,47)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('pomegranate',anim,756,506,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/ring.png',0,0,90,89,1,0)
	anim:SetHotSpot(45,44)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('ring',anim,651,668,107,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/sabre.png',0,0,199,99,1,0)
	anim:SetHotSpot(99,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('sabre',anim,505,50,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/scalp.png',0,0,119,187,1,0)
	anim:SetHotSpot(59,93)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('scalp',anim,991,344,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/scorpion.png',0,0,146,154,1,0)
	anim:SetHotSpot(73,77)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('scorpion',anim,739,430,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/spider.png',0,0,115,97,1,0)
	anim:SetHotSpot(57,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('spider',anim,321,87,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/statuette.png',0,0,141,189,1,0)
	anim:SetHotSpot(70,94)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('statuette',anim,376,484,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/stone.png',0,0,150,182,1,0)
	anim:SetHotSpot(75,91)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('stone',anim,669,617,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/tambourine.png',0,0,132,120,1,0)
	anim:SetHotSpot(66,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('tambourine',anim,848,63,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/watermelon.png',0,0,186,145,1,0)
	anim:SetHotSpot(93,72)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('watermelon',anim,244,613,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/wing.png',0,0,178,220,1,0)
	anim:SetHotSpot(89,110)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('wing',anim,259,403,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/wreath.png',0,0,209,222,1,0)
	anim:SetHotSpot(104,111)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('wreath',anim,918,164,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Misc/xylophone.png',0,0,222,205,1,0)
	anim:SetHotSpot(111,102)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('xylophone',anim,800,485,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverAmphora.png',0,0,218,119,1,0)
	anim:SetHotSpot(109,59)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverAmphora',anim,916,608,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverCat.png',0,0,140,120,1,0)
	anim:SetHotSpot(70,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverCat',anim,283,446,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverCinnamon.png',0,0,123,112,1,0)
	anim:SetHotSpot(61,56)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverCinnamon',anim,178,421,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverCorn.png',0,0,168,200,1,0)
	anim:SetHotSpot(84,100)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverCorn',anim,331,286,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverGrapes.png',0,0,154,119,1,0)
	anim:SetHotSpot(77,59)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverGrapes',anim,175,430,107,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverGuard.png',0,0,285,499,1,0)
	anim:SetHotSpot(142,249)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverGuard',anim,881,340,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverMagicSphere.png',0,0,256,138,1,0)
	anim:SetHotSpot(128,69)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverMagicSphere',anim,821,699,108,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverMaraca.png',0,0,101,88,1,0)
	anim:SetHotSpot(50,44)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverMaraca',anim,613,704,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverNuts.png',0,0,181,177,1,0)
	anim:SetHotSpot(90,88)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverNuts',anim,323,567,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverPineapple.png',0,0,134,89,1,0)
	anim:SetHotSpot(67,44)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverPineapple',anim,140,285,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverSabre.png',0,0,199,99,1,0)
	anim:SetHotSpot(99,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverSabre',anim,506,50,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverScalp.png',0,0,114,122,1,0)
	anim:SetHotSpot(57,61)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverScalp',anim,965,314,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverWing.png',0,0,178,220,1,0)
	anim:SetHotSpot(89,110)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverWing',anim,266,401,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/LayerOverWreath.png',0,0,209,222,1,0)
	anim:SetHotSpot(104,111)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('LayerOverWreath',anim,923,167,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/magicSphere.png',0,0,174,186,1,0)
	anim:SetHotSpot(87,93)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('magicSphere',anim,814,643,106,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('0xFFFF1088')
	play_field:CreateObject('magicSphereGlow1',anim,810,633,107,0,2.6,2.6)
	local anim = CreateAnimation('data/Texture/Scenes/Common/radialGlow.png',0,0,97,99,1,0)
	anim:SetHotSpot(48,48)
	anim:SetBlendMode(0)
	anim:SetColor('0xFF4410FF')
	play_field:CreateObject('magicSphereGlow2',anim,804,637,107,0,2.6,2.6)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/potWaterPlane.png',0,0,80,20,1,0)
	anim:SetHotSpot(40,40)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('potWaterPlane',anim,357,629,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/pot.png',0,0,106,130,1,0)
	anim:SetHotSpot(53,65)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('pot',anim,355,609,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/mechanismRope.png',0,0,545,336,1,0)
	anim:SetHotSpot(272,168)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechanismRope',anim,668,334,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/mechanismWheel.png',0,0,62,66,1,0)
	anim:SetHotSpot(31,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('mechanismWheel',anim,454,223,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/entranceLight.png',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('entranceLight',anim,501,425,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Layers/potBoilingWaterAnim.png',0,0,117,76,18,12)
	anim:SetHotSpot(59,38)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('potBoilingWaterAnim',anim,354,594,107,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Basin.png',0,0,71,54,1,0)
	anim:SetHotSpot(35,27)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Basin',anim,512,741,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Flint.png',0,0,70,48,1,0)
	anim:SetHotSpot(35,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Flint',anim,901,689,109,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Handle.png',0,0,63,37,1,0)
	anim:SetHotSpot(31,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Handle',anim,918,45,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Herb.png',0,0,47,134,1,0)
	anim:SetHotSpot(23,67)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Herb',anim,396,95,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Jar.png',0,0,58,73,1,0)
	anim:SetHotSpot(29,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Jar',anim,323,743,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Rag.png',0,0,100,57,1,0)
	anim:SetHotSpot(50,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Rag',anim,170,170,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Handle_onPlace.png',0,0,63,37,1,0)
	anim:SetHotSpot(18,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Handle_onPlace',anim,443,468,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Rag_onPlace.png',0,0,65,102,1,0)
	anim:SetHotSpot(32,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Rag_onPlace',anim,517,271,103,-4,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('actZonePot',anim,353,604,108,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('actZoneEmbers',anim,348,673,107,-5,1.4,0.6)
	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('actZoneHandle',anim,449,439,104,0,0.7,0.9)
	local anim = CreateAnimation('data/Texture/Scenes/Common/radialGlow.png',0,0,97,99,1,0)
	anim:SetHotSpot(48,48)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFF5510')
	play_field:CreateObject('embersGlow1',anim,343,669,106,0,1.8,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('0xFFFF5510')
	play_field:CreateObject('embersGlow2',anim,343,669,106,0,1.8,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Basin_ghost.png',0,0,86,74,1,0)
	anim:SetHotSpot(43,43)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Basin_ghost',anim,293,571,110,30,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Flint_ghost.png',0,0,124,111,1,0)
	anim:SetHotSpot(62,62)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Flint_ghost',anim,366,703,110,0,0.5,0.5)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Handle_ghost.png',0,0,91,65,1,0)
	anim:SetHotSpot(45,32)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Handle_ghost',anim,455,468,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Herb_ghost.png',0,0,79,164,1,0)
	anim:SetHotSpot(39,39)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Herb_ghost',anim,428,552,110,50,0.6,0.6)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Jar_ghost.png',0,0,100,134,1,0)
	anim:SetHotSpot(50,50)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Jar_ghost',anim,357,524,110,0,0.6,0.6)
	local anim = CreateAnimation('data/Texture/Scenes/12_ShamansHut/Items/Rag_ghost.png',0,0,80,140,1,0)
	anim:SetHotSpot(40,70)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	play_field:CreateObject('Rag_ghost',anim,357,542,110,0,1,1)
end

function FreeData()
end
-- CLEAR_ON_SAVE_END
