
.namespace hotspotcarte

function OnActivate()
	
		if self.Name == "Hotspot_wrong" then
			if translaparch==0 then	
				clicwrong=clicwrong+1
				if clicwrong ~= 3 then
					SequencePlayer.Enabled = true
					SequencePlayer.PlayRandomSequence({"GP_1005","GP_1006","GP_1007"},nil,nil)
				end
			else
				translaparch=0
			end	
		end
		
		if clicwrong==3 then
			clicwrong=0
			PlaySoundEffect("int_closeupfail")
			SequencePlayer.Enabled = true
			SequencePlayer.PlaySequence("GP_1008",nil,nil)
		end
	
		if self.Name == "Hotspot_right" then
			if translaparch==0 then	
			
				trajet_3.Play(self)
				 PlaySoundEffect("int_revealdestination")
			else
				translaparch=0
			end
		end
		
		if self.Name == "parchemin_hotspot_1" then
			if translaparch==0 then
				translaparch=1
			elseif translaparch==1 then
				translaparch=0
			end
		end
		
end

function OnAnimationEnd ()
	if UserData.IsEqual("s11_discovered",false) then
		SequencePlayer.Enabled = true
		SequencePlayer.PlaySequence("GP_1004",self,nil)
		rond3.Enabled= true
		SpriteFader.Fade(rond3,true,1)
	end
end

function OnSequenceEnd(dialogue)
	if dialogue == "GP_1004" then
		Itsawin()
	end
end

function Itsawin()
	s10_c02.Enabled = false
	NavigationManager.SwitchTo(nil,"TR_3")
	PlaySoundEffect("int_closeupwin")
	InventoryManager.RemoveFromInventory("InventoryParcheminTraduit")
end

function OnEnable()
	AreaHotspot.OnEnable()
	clicwrong=0
end

function GetSpecificCursor()
	if self.Name == "Hotspot_wrong" or self.Name == "Hotspot_right"   then
		return 0
	end
	return CURSOR_AREA_HOTSPOT
end

function PrivateCanClickOn()
	return true
end

