function HasActionAfterStatistics(level)
	local funcName = "HasActionAfterStatistics_"..tostring(level)
	if _G[funcName] ~= nil then
		return _G[funcName]()
	else
		return false
	end
end

---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
function RE2A_01_01(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_AllLootWillDisappearSoonHint")
		AddSmartHint("RE2A_ThreeLootsLostHint")
		AddSmartHint("RE2A_FirstHouseWasBuilt")
		AddSmartHint("RE2A_Build1HouseHint")
		AddSmartHint("RE2A_Build2HouseHint")
		AddSmartHint("RE2A_Build3HouseHint")
		AddSmartHint("RE2A_Build4HouseHint")
		AddSmartHint("RE2A_Build5HouseHint")
		DialogOnLevelLoad()
	end

	local houseId = 131699
	local levelId = "RE2A_01_01"

	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinishNoHide()
			return
		end
		local sed = "Sedrik"
		local loc = "ParrotGuy"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		
		DialogAddLine(sed, "RE2A_01_01_01")
		DialogAddLine(loc, "RE2A_01_01_02")
		DialogAddLine(sed, "RE2A_01_01_03")
		DialogAddLine(loc, "RE2A_01_01_04")
		DialogAddLine(sed, "RE2A_01_01_05")
		DialogStart()

		if tutorial:getHouse(houseId) then
			tutorial:getHouse(houseId):AllowGenerateLootByTutorial(false)
			tutorial:getHouse(houseId):setRentPercent(80)
		end
		tutorial:variables():setBool("TutorialFirstHousePodstava", true)
		tutorial:variables():setBool("TutorialRentgenEnabled", false)
		tutorial:variables():setInt("TutorialFirstHouseFieldId", 0)
	elseif message:is("BuildingStarted") then
		if tutGetInt("TutorialFirstHouseFieldId") == 0 then
			tutorial:variables():setInt("TutorialFirstHouseFieldId", message:getIntegerParam())
		end
	elseif message:is("RentTimeGenerated") then
		tutorial:variables():setBool("TutorialRentgenEnabled", true)
		if tutorial:getHouse(houseId) then
			tutorial:getHouse(houseId):AllowGenerateLootByTutorial(true)
		end
		tutorial:variables():setBool("TutorialFirstHousePodstava", false)
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_01_02(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_AllLootWillDisappearSoonHint")
		AddSmartHint("RE2A_FiveLootsLostHint")
		AddSmartHint("RE2A_StartCuttingTreesHint")
		AddSmartHint("RE2A_LackOfWorkersHint")
		AddSmartHint("RE2A_LackOfMaterialsHint")
		AddSmartHint("RE2A_ClickOnUnreachableObjectsHint")

		DialogOnLevelLoad()
	end
end

function RE2A_01_03(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_AllLootWillDisappearSoonHint")
		AddSmartHint("RE2A_FiveLootsLostHint")
		AddSmartHint("RE2A_BuildSawmillHint")
		AddSmartHint("RE2A_ProduceMoreWoodInSawmillHint")
		AddSmartHint("RE2A_DidNotGatherFoodFor30SecondsHint")
		AddSmartHint("RE2A_GatherFoodFromBushesHint")
		AddSmartHint("RE2A_01_03_AllTasksAreReadyButGatherFoodHint")
		AddSmartHint("RE2A_01_03_AllTasksAreReadyButUpgradedCabinsHint")

		DialogOnLevelLoad()
	end
end

function Map_TargetAllPiers(pier)
	local pierPosition = pier:getField():getScreenPosition()
	local offset = IPoint(20, 10)
	local arrowId = tutorial:addArrow()
	tutorial:getArrow(arrowId):setPosition(pierPosition.x + offset.x, pierPosition.y + offset.y)
	tutorial:getArrow(arrowId):setAngle(270)
	tutorial:getArrow(arrowId):setShowTimer(0.5)
	tutorial:getArrow(arrowId):show(0.25)
	tutorial:getArrow(arrowId):setScale(0.7)
	tutorial:show(0.25)
	tutSetInt("RE2A_01_04_Pier"..tostring(pier:id()), arrowId)
end

function RE2A_01_04(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_AllLootWillDisappearSoonHint")
		AddSmartHint("RE2A_FiveLootsLostSedrikFishingHint")
		AddSmartHint("RE2A_01_04_NoPierWasSelectedFor30SecondsHint")
		AddSmartHint("RE2A_01_04_NoPierWasRepairedFor60SecondsHint")
		AddSmartHint("RE2A_01_04_ThereIsMoreBrokenPiersHint")
		AddSmartHint("RE2A_FishLootLaysTooLongHint")
		AddSmartHint("RE2A_01_04_NoFreeWorkersFor20SecondsHint")
		
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_01_04"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		DialogForbidRentGeneration()
		
		local sed = "Sedrik"
		local sedFishing = "SedrikFishing"
		local loc = "ParrotGuy"

		local sedPos = IPoint(125, 300)
		DialogInit(levelId)
		DialogAddCharacterAtPositionAndOrientation(sed, sedPos, false)
		DialogAddCharacter(loc, RightAvatarPosition)

		DialogAddLine(loc, "RE2A_01_04_01")
		DialogAddLine(sed, "RE2A_01_04_02")
		DialogAddLua(function()
			local piers = tutorial:collectBuildingsWithType("Pier")
			tutorial:map(piers, "Map_TargetAllPiers")
		end)
		DialogAddLine(loc, "RE2A_01_04_03")
		DialogAddLua(function()
			DialogAddCharacterAtPositionAndOrientation(sedFishing, sedPos, false)
			DialogAddLine(sedFishing, "RE2A_01_04_04")
		end)
		DialogAddLua(function()
			tutorial:hideArrows(0.25)
			DialogAllowRentGeneration()
		end)

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_02_01(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_02_01_SwampClickHint")
		AddSmartHint("RE2A_02_01_GamerProbablyConfusedHousedHint")
		
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_02_01"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local sed = "Sedrik"
		local loc = "TropicGirl"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		
		DialogAddLine(sed, "RE2A_02_01_01")
		DialogAddLine(loc, "RE2A_02_01_02")
		DialogAddLine(sed, "RE2A_02_01_03")
		DialogAddLine(sed, "RE2A_02_01_04")

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_02_02(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_PointAtElephantEveryThirdClickAtSwampHint")
		AddSmartHint("RE2A_GoldMineWasNotRepairedFor60SecondsHint")
		AddSmartHint("RE2A_02_02_SendWorkersToGoldMineLeftHint")
		AddSmartHint("RE2A_02_02_SendWorkersToGoldMineRightHint")
		AddSmartHint("RE2A_02_02_SendMoreWorkersToGoldMineHint")

		DialogOnLevelLoad()
	end

	local levelId = "RE2A_02_02"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local sed = "Sedrik"
		local loc = "TropicGirl"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		
		DialogAddLine(loc, "RE2A_02_02_01")
		DialogAddLine(sed, "RE2A_02_02_02")
		DialogAddLine(sed, "RE2A_02_02_03")

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function HasActionAfterStatistics_RE2A_02_03()
	local levelId = "RE2A_02_03"
	if IsFinishTutShowed(levelId) then
		return false
	else
		return true
	end
end
function RE2A_02_03(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_SendMoreWorkersToForestAreaHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_02_03"
	if message:is("LoadLevel") then
		DialogFinish()
		DialogForLevelEndStarted = false
	elseif message:is("ActionAfterStatistics") then
		if IsFinishTutShowed(levelId) then
			DialogFinish()
			return
		end
		if DialogForLevelEndStarted == false then
			DialogForLevelEndStarted = true
			ForbidLevelFinish()

			DialogInit(levelId)
			tutSetBool("DialogAfterStatistics", true)

			DialogWait(0.5)
			DialogAddEarthQuake(5, 20, 8)
			DialogPlaySample("GoldMinesCollapse")
			DialogAddLua(function()
				tutorial:game():AcceptMessage(Message("MakeWorkersInFinalCrowedPuzzled"))
			end)
			DialogAddEffect("Tutorial_Level7_smoke", IPoint(130, 610))
			DialogWait(0.5)
			DialogAddEffect("Tutorial_Level7_smoke", IPoint(300, 610))
			DialogWait(0.7)
			DialogAddEffect("Tutorial_Level7_smoke", IPoint(100, 500))
			DialogWait(3.5)
			DialogAddLua(function()
				SetFinishTutShowed_AfterStatistics(levelId)
			end)

			DialogStart()
		end
	end

	if not IsTutShowed(levelId) or not IsFinishTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_03_01(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_TreasureWasNotDiggedFor10SecondsHint")
		AddSmartHint("RE2A_SendWorkerToTrunkHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_03_01"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local sed = "Sedrik"
		local loc = "FeatherGirl"

		DialogInit(levelId)
		DialogAddEffect("Tutorial_balloonFlyDown_dop", IPoint(90, 535))
		DialogWait(4.0)
		DialogAddLua(function()
			DialogAddCharacter(sed, LeftAvatarPosition)
			DialogAddCharacter(loc, RightAvatarPosition)
		end)
		DialogAddLine(sed, "RE2A_03_01_01")
		DialogAddLine(loc, "RE2A_03_01_02")
		DialogAddLine(loc, "RE2A_03_01_03")
		DialogAddLine(loc, "RE2A_03_01_04")
		DialogAddLine(sed, "RE2A_03_01_05")

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_03_02(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_SendMoreWorkersToFarmHint")
		AddSmartHint("RE2A_03_02_NoWorkerClickHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_03_02"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "FeatherGirl"

		DialogInit(levelId)
		DialogAddCharacter(loc, LeftAvatarPosition)
		
		DialogAddLua(function()
			tutorial:addArrow()
			tutorial:getArrow(0):setPosition(665, 300)
			tutorial:getArrow(0):setAngle(270)
			tutorial:getArrow(0):show(0.5)
		end)
		DialogAddLine(loc, "RE2A_03_02_01")
		DialogAddLine(loc, "RE2A_03_02_02")
		DialogAddLua(function()
			tutorial:hideArrows(0.25)
		end)

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function HasActionAfterStatistics_RE2A_03_03()
	local levelId = "RE2A_03_03"
	if IsFinishTutShowed(levelId) then
		return false
	else
		return true
	end
end
function RE2A_03_03(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_03_03_NoWorkerClickHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_03_03"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local sed = "Sedrik"
		local loc = "FeatherGirl"
		DialogForLevelEndStarted = false

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		DialogAddLua(function()
			tutorial:addArrow()
			tutorial:getArrow(0):setPosition(512, 600)
			tutorial:getArrow(0):setAngle(270)
			tutorial:getArrow(0):show(0.5)
		end)
		DialogAddLine(sed, "RE2A_03_03_01")
		DialogAddLine(loc, "RE2A_03_03_02")
		DialogAddLua(function()
			tutorial:hideArrows(0.25)
		end)
		DialogAddEffect("Tutorial_Babrokon_shadow", IPoint(373, 371))
		DialogPlaySample("TutorialAir")
		DialogPlaySample("TutorialBobrakonRoar")
		DialogStart()

	elseif message:is("ActionAfterStatistics") then
		if IsFinishTutShowed(levelId) then
			DialogFinish()
			return
		end

		if DialogForLevelEndStarted == false then
			DialogForLevelEndStarted = true
			ForbidLevelFinish()
			local sed = "Sedrik"
			local loc = "FeatherGirl"

			DialogInit(levelId)
			tutSetBool("DialogAfterStatistics", true)

			DialogAddEffect("Tutorial_balloonFlyAway", IPoint(-135, 454))
			DialogWait(2.0)
			DialogWait(1.0)
			DialogAddLua(function()
				DialogAddCharacter(sed, LeftAvatarPosition)
				DialogAddCharacter(loc, RightAvatarPosition)
			end)
			DialogAddLine(sed, "RE2A_03_03_03")
			DialogAddLine(loc, "RE2A_03_03_04")
			DialogAddLine(sed, "RE2A_03_03_05")
			DialogWait(1.0)
			DialogAddLua(function()
				SetFinishTutShowed_AfterStatistics(levelId)
			end)

			DialogStart()
		end
	end

	if not IsTutShowed(levelId) or not IsFinishTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_03_04(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_03_04"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local sed = "Sedrik"
		local loc = "FeatherGirl"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		
		DialogAddLine(sed, "RE2A_03_04_01")
		DialogAddLine(sed, "RE2A_03_04_02")
		DialogAddLine(loc, "RE2A_03_04_03")
		DialogAddLine(sed, "RE2A_03_04_04")

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_03_05(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_03_06(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_ShowArrowsOnCaveSmokesHint")
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		AddSmartHint("RE2A_03_06_CaveDoorWasOpenHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_03_06"
	if message:is("LoadLevel") then
		DialogForLevelEndStarted = false
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local sed = "Sedrik"
		local loc = "FeatherGirl"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		
		DialogAddLine(sed, "RE2A_03_06_01")
		DialogAddLine(loc, "RE2A_03_06_02")
		DialogAddLine(sed, "RE2A_03_06_03")
		DialogAddLine(loc, "RE2A_03_06_04")

		DialogStart()
	elseif message:is("FinishLevel") then
		if IsFinishTutShowed(levelId) then
			DialogFinish()
			return
		end

		if DialogForLevelEndStarted == false then
			DialogForLevelEndStarted = true
			ForbidLevelFinish()

			local sed = "Sedrik"

			DialogInit(levelId)
			tutSetBool("DialogOnFinishLevel", true)

			DialogWait(4.0)
			DialogAddEffect("Tutorial_Bobrakon", IPoint(622, 635))
			DialogWait(2.0)
			DialogAddLua(function()
				DialogAddCharacter(sed, LeftAvatarPosition)
			end)
			DialogAddLine(sed, "RE2A_03_06_05")
			DialogAddLine(sed, "RE2A_03_06_06")

			DialogNiceDialogEndOnLevelFinish()
			DialogWait(1.0)
			DialogAddLua(function()
				SetFinishTutShowed(levelId)
			end)

			DialogStart()
		end	
	end

	if not IsTutShowed(levelId) or not IsFinishTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_04_01(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		AddSmartHint("RE2A_04_01_StartDialogHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_04_01"

	if message:is("LoadLevel") then
		DialogForLevelEndStarted = false
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end

		if not IsFinishTutShowed(levelId) then
			local robber = tutorial:getRobber(111382)
			if robber ~= nil then
				robber:setRobberIsAllowedToDisappear(false)
			end
		end
	elseif message:is("FinishLevel") then
		if IsFinishTutShowed(levelId) then
			DialogFinish()
			return
		end

		if DialogForLevelEndStarted == false then
			DialogForLevelEndStarted = true
			ForbidLevelFinish()

			local sed = "Sedrik"
			local loc = "Pirat"

			DialogInit(levelId)
			tutSetBool("DialogOnFinishLevel", true)

			DialogAddCharacterAtPositionAndOrientation(loc, IPoint(930, 400), true)
			DialogAddLua(function()
				tutorial:nSetJumpAppear(loc, true)
			end)
			DialogWait(0.5)
			DialogAddLua(function()
				DialogAddCharacterAtPositionAndOrientation(sed, IPoint(100, 400), false)
			end)
			DialogAddLine(loc, "RE2A_04_01_07")
			DialogAddLine(loc, "RE2A_04_01_08")
			DialogAddLine(loc, "RE2A_04_01_09")
			DialogAddLine(sed, "RE2A_04_01_10")
			DialogAddLua(function()
				tutorial:getRobber(111382):setRobberIsAllowedToDisappear(true)
			end)
			DialogNiceDialogEndOnLevelFinish()
			DialogWait(0.5)
			DialogAddLua(function()
				tutorial:getRobber(111382):setRobberIsAllowedToDisappear(true)
				SetFinishTutShowed(levelId)
			end)

			DialogStart()
		end
	end

	if not IsTutShowed(levelId) or not IsFinishTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_04_02(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		AddSmartHint("RE2A_04_02_DidNotStartRestoringTorchesFor10SecondsHint")
		AddSmartHint("RE2A_04_02_LitMoreTorchesHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_04_02"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local sed = "Sedrik"
		local loc = "Tippy"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		
		
		DialogAddLine(sed, "RE2A_04_02_01")
		DialogAddLua(function()
			DialogAddCharacter(loc, RightAvatarPosition)
		end)
		DialogAddLine(loc, "RE2A_04_02_02")
		DialogAddLine(loc, "RE2A_04_02_03")
		DialogAddLine(sed, "RE2A_04_02_04")
		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_04_03(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		AddSmartHint("RE2A_04_03_DigThatTreasureAlreadyHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_04_04(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		AddSmartHint("RE2A_YouMustPayToTorchTimedPirateAgainAndAgainHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_04_04"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "Tippy"

		DialogInit(levelId)
		DialogAddCharacter(loc, LeftAvatarPosition)
		
		DialogAddLua(function()
			tutorial:addArrow()
			tutorial:getArrow(0):setPosition(816, 550)
			tutorial:getArrow(0):setAngle(270)
			tutorial:getArrow(0):show(0.5)
		end)
		DialogAddLine(loc, "RE2A_04_04_01")
		DialogAddLine(loc, "RE2A_04_04_02")
		DialogAddLua(function()
			tutorial:getArrow(0):hide(0.25)
		end)
		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_04_05(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

-- 20
function RE2A_04_06(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		AddSmartHint("RE2A_04_06_CoalStoneHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_04_06"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "Tippy"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacterAtPositionAndOrientation(sed, IPoint(100, 500), false)
		DialogAddCharacterAtPositionAndOrientation(loc, IPoint(900, 500), true)

		DialogAddLine(loc, "RE2A_04_06_01")
		DialogAddLua(function()
			tutorial:addArrow()
			tutorial:getArrow(0):setPosition(540, 365)
			tutorial:getArrow(0):setAngle(270)
			tutorial:getArrow(0):show(0.5)
		end)
		DialogAddLine(sed, "RE2A_04_06_02")
		DialogAddLine(sed, "RE2A_04_06_03")
		DialogAddLine(loc, "RE2A_04_06_04")
		DialogAddLua(function()
			tutorial:getArrow(0):hide(0.25)
		end)

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_05_01(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		AddSmartHint("RE2A_05_01_YouHaveEnoughWoodSoBuildTheWellHint")
		DialogOnLevelLoad()
	end
	
	local levelId = "RE2A_05_01"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "Fakir"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		
		DialogAddLine(loc, "RE2A_05_01_01")
		DialogAddLine(sed, "RE2A_05_01_02")
		DialogAddLine(loc, "RE2A_05_01_03")
		DialogAddLine(loc, "RE2A_05_01_04")
		DialogAddLine(sed, "RE2A_05_01_05")
		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_05_02(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_05_02"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "Fakir"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)

		DialogAddLine(sed, "RE2A_05_02_01")
		DialogAddLine(loc, "RE2A_05_02_02")
		DialogAddLine(sed, "RE2A_05_02_03")
		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_05_03(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_05_03"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end

		local loc = "Fakir"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		
		DialogAddLine(sed, "RE2A_05_03_01")
		DialogAddLine(loc, "RE2A_05_03_02")
		DialogAddLine(sed, "RE2A_05_03_03")
		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_05_04(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_05_05(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_05_05"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "Fakir"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacterAtPositionAndOrientation(sed, IPoint(100, 450), false)
		DialogAddCharacterAtPositionAndOrientation(loc, IPoint(900, 450), true)

		DialogAddLine(sed, "RE2A_05_05_01")
		DialogAddLua(function()
			tutorial:addArrow()
			tutorial:getArrow(0):setPosition(375, 340)
			tutorial:getArrow(0):setAngle(270)
			tutorial:getArrow(0):show(0.5)
		end)
		DialogAddLine(loc, "RE2A_05_05_02")
		DialogAddLine(sed, "RE2A_05_05_03")
		DialogAddLua(function()
			tutorial:getArrow(0):hide(0.25)
		end)
		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_05_06(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_05_07(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_05_07"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "Fakir"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		
		DialogAddLua(function()
			tutorial:addArrow()
			tutorial:getArrow(0):setPosition(880, 185)
			tutorial:getArrow(0):setAngle(90)
			tutorial:getArrow(0):show(0.5)
		end)
		DialogAddLine(sed, "RE2A_05_07_01")
		DialogAddLua(function()
			tutorial:getArrow(0):hide(0.25)
		end)
		DialogAddLine(sed, "RE2A_05_07_02")
		DialogAddLua(function()
			tutorial:getArrow(0):setPosition(183, 565)
			tutorial:getArrow(0):setAngle(270)
			tutorial:getArrow(0):show(0.5)
		end)
		DialogAddLine(loc, "RE2A_05_07_03")
		DialogAddLua(function()
			tutorial:getArrow(0):hide(0.25)
		end)
		DialogWait(0.25)
		DialogAddLua(function()
			tutorial:getArrow(0):setPosition(308, 455)
			tutorial:getArrow(0):setAngle(270)
			tutorial:getArrow(0):show(0.5)
		end)
		DialogAddLine(loc, "RE2A_05_07_04")
		DialogAddLua(function()
			tutorial:getArrow(0):hide(0.25)
		end)
		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_06_01(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_06_01"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "Bubba"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		
		DialogAddLine(sed, "RE2A_06_01_01")
		DialogAddLine(loc, "RE2A_06_01_02")
		DialogAddLine(sed, "RE2A_06_01_03")
		DialogAddLine(loc, "RE2A_06_01_04")
		DialogAddLine(sed, "RE2A_06_01_05")
		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_06_02(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_06_02"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "Bubba"
		local sed = "Sedrik"

		DialogInit(levelId)

		DialogAddCharacterAtPositionAndOrientation(sed, IPoint(100, 350), false)
		DialogAddCharacterAtPositionAndOrientation(loc, IPoint(900, 350), true)
		
		DialogAddLua(function()
			tutorial:addArrow()
			tutorial:getArrow(0):setPosition(90, 615)
			tutorial:getArrow(0):setAngle(270)
			tutorial:getArrow(0):show(0.5)

			tutorial:addArrow()
			tutorial:getArrow(1):setPosition(695, 255)
			tutorial:getArrow(1):setAngle(270)
			tutorial:getArrow(1):show(0.5)
		end)

		DialogAddLine(loc, "RE2A_06_02_01")
		DialogAddLine(sed, "RE2A_06_02_02")
		DialogAddLua(function()
			tutorial:getArrow(0):hide(0.25)
			tutorial:getArrow(1):hide(0.25)
		end)

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_06_03(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_06_03"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "Bubba"

		DialogInit(levelId)
		DialogAddCharacter(loc, LeftAvatarPosition)
		
		DialogAddLua(function()
			tutorial:addArrow()
			tutorial:getArrow(0):setPosition(535, 524)
			tutorial:getArrow(0):setAngle(270)
			tutorial:getArrow(0):show(0.5)
		end)
		DialogAddLine(loc, "RE2A_06_03_01")
		DialogAddLine(loc, "RE2A_06_03_02")
		DialogAddLua(function()
			tutorial:getArrow(0):hide(0.25)
		end)
		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_06_04(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_06_05(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_06_06(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_06_07(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_06_07"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end

		local loc = "Bubba"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacter(sed, IPoint(100, 200))
		DialogAddCharacterAtPositionAndOrientation(loc, IPoint(900, 200), true)
		
		DialogAddLua(function()
			tutorial:addArrow()
			tutorial:getArrow(0):setPosition(575, 555)
			tutorial:getArrow(0):setAngle(270)
			tutorial:getArrow(0):show(0.5)
		end)
		DialogAddLine(loc, "RE2A_06_07_01")
		DialogAddLine(sed, "RE2A_06_07_02")
		DialogAddLua(function()
			tutorial:getArrow(0):hide(0.25)
		end)
		DialogStart()

	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_07_01(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_07_01"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end

		local loc = "Saruman"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		
		DialogAddLine(sed, "RE2A_07_01_01")
		DialogAddLua(function()
			DialogAddCharacter(loc, RightAvatarPosition)
		end)
		DialogAddLine(loc, "RE2A_07_01_02")
		DialogAddLine(sed, "RE2A_07_01_03")
		DialogAddLine(loc, "RE2A_07_01_04")
		DialogAddLine(sed, "RE2A_07_01_05")
		DialogStart()

	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_07_02(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_07_03(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		AddSmartHint("RE2A_07_03_DruidLitTheFireHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_07_04(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end

end

function RE2A_07_05(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_07_05"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end

		local loc = "Saruman"

		DialogInit(levelId)
		DialogAddCharacter(loc, LeftAvatarPosition)
		
		DialogAddLine(loc, "RE2A_07_05_01")
		DialogAddLua(function()
			tutorial:addArrow()
			tutorial:getArrow(0):setPosition(430, 540)
			tutorial:getArrow(0):setAngle(270)
			tutorial:getArrow(0):show(0.5)
		end)
		DialogAddLine(loc, "RE2A_07_05_02")
		DialogAddLua(function()
			tutorial:getArrow(0):hide(0.25)
		end)
		DialogStart()

	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_07_06(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_07_07(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_07_08(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		AddSmartHint("RE2A_07_08_ThereIsTheUniHint")
		AddSmartHint("RE2A_07_08_ThereIsTheTeacherHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_07_08"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end

		local loc = "Saruman"

		DialogInit(levelId)
		DialogAddCharacter(loc, LeftAvatarPosition)
		
		DialogAddLine(loc, "RE2A_07_08_01")
		DialogAddLine(loc, "RE2A_07_08_02")
		DialogStart()

	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_08_01(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_08_01"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end

		local loc = "Santa"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		DialogForbidRentGeneration()

		DialogAddLine(sed, "RE2A_08_01_01")
		DialogAddLine(loc, "RE2A_08_01_02")
		DialogAddLine(loc, "RE2A_08_01_03")
		DialogAddLine(loc, "RE2A_08_01_04")
		DialogAddLine(sed, "RE2A_08_01_05")
		DialogAddLine(sed, "RE2A_08_01_06")
		DialogAllowRentGeneration()

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_08_02(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_08_03(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_08_03"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end

		local loc = "Santa"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacterAtPositionAndOrientation(sed, IPoint(100, 200), false)
		DialogAddCharacterAtPositionAndOrientation(loc, IPoint(900, 200), true)
		DialogForbidRentGeneration()

		DialogAddLine(loc, "RE2A_08_03_01")
		DialogAddLine(loc, "RE2A_08_03_02")
		DialogAddLine(sed, "RE2A_08_03_03")
		DialogAllowRentGeneration()

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_08_04(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_08_05(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_08_05"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end

		local loc = "Santa"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		
		DialogAddLine(loc, "RE2A_08_05_01")
		DialogAddLine(sed, "RE2A_08_05_02")
		DialogAddLine(loc, "RE2A_08_05_03")
		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_08_06(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function Map_TargetWinterBalloonTraders(trader)
	local traderPosition = trader:getField():getScreenPosition()
	local offset = IPoint(-5, 50)
	local arrowId = tutorial:addArrow()
	tutorial:getArrow(arrowId):setPosition(traderPosition.x + offset.x, traderPosition.y + offset.y)
	tutorial:getArrow(arrowId):setAngle(270)
	tutorial:getArrow(arrowId):setShowTimer(0.5)
	tutorial:getArrow(arrowId):show(0.25)
	tutorial:getArrow(arrowId):setScale(0.7)
	tutorial:show(0.25)
	tutSetInt("RE2A_08_07"..tostring(trader:id()), arrowId)
end

function RE2A_08_07(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_08_07"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end

		local loc = "Santa"
		local sed = "Sedrik"
		DialogForLevelEndStarted = false

		DialogInit(levelId)
		DialogAddCharacter(sed, IPoint(100, 200))
		DialogAddCharacterAtPositionAndOrientation(loc, IPoint(900, 200), true)
		DialogForbidRentGeneration()

		DialogAddLine(loc, "RE2A_08_07_01")
		DialogAddLua(function()
			local traders = tutorial:collectBuildingsWithType("WinterBalloonTrader")
			tutorial:map(traders, "Map_TargetWinterBalloonTraders")
		end)
		DialogAddLine(loc, "RE2A_08_07_02")
		DialogAddLine(sed, "RE2A_08_07_03")
		DialogAddLua(function()
			tutorial:hideArrows(0.25)
		end)
		DialogAllowRentGeneration()

		DialogStart()
	elseif message:is("FinishLevel") then
		if IsFinishTutShowed(levelId) then
			DialogFinish()
			return
		end

		if DialogForLevelEndStarted == false then
			DialogForLevelEndStarted = true
			ForbidLevelFinish()
			local sed = "Sedrik"
			local loc = "Santa"

			DialogInit(levelId)
			tutSetBool("DialogOnFinishLevel", true)

			DialogWait(1.0)
			DialogAddLua(function()
				DialogAddCharacter(sed, LeftAvatarPosition)
				DialogAddCharacter(loc, RightAvatarPosition)
			end)
			DialogAddLine(sed, "RE2A_08_07_04")
			DialogAddLine(loc, "RE2A_08_07_05")
			DialogNiceDialogEndOnLevelFinish()
			DialogWait(1.0)
			DialogAddLua(function()
				SetFinishTutShowed(levelId)
			end)

			DialogStart()
		end		
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end

	if not IsFinishTutShowed(levelId) and DialogForLevelEndStarted == true then
		DialogProcessMessage(message)
	end
end

function RE2A_09_01(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_09_01"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local sed = "Sedrik"
		local loc = "FeatherGuy"

		DialogInit(levelId)
		DialogForbidRentGeneration()

		DialogAddEffect("Tutorial_balloonFlyDown_50", IPoint(76, 485))
		DialogWait(5.5)
		DialogAddLua(function()
			DialogAddCharacter(sed, LeftAvatarPosition)
			DialogAddCharacter(loc, RightAvatarPosition)
		end)
		DialogAddLine(sed, "RE2A_09_01_01")
		DialogAddLine(loc, "RE2A_09_01_02")
		DialogAddLine(loc, "RE2A_09_01_03")
		DialogAddLine(sed, "RE2A_09_01_04")
		DialogAllowRentGeneration()

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_09_02(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_09_03(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_09_03"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end

		local loc = "FeatherGuy"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacterAtPositionAndOrientation(sed, IPoint(100, 400), false)
		DialogAddCharacterAtPositionAndOrientation(loc, IPoint(900, 400), true)
		
		DialogAddLua(function()
			local arrowId = tutorial:addArrow()
			tutorial:getArrow(arrowId):setPosition(910, 325)
			tutorial:getArrow(arrowId):setAngle(270)
			tutorial:getArrow(arrowId):show(0.5)
		end)
		DialogAddLine(sed, "RE2A_09_03_01")
		DialogAddLine(loc, "RE2A_09_03_02")
		DialogAddLua(function()
			tutorial:hideArrows(0.25)
		end)
		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_09_04(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_09_05_AddArrow(pos)
	local arrowId = tutorial:addArrow()
	tutorial:getArrow(arrowId):setPosition(pos.x, pos.y)
	tutorial:getArrow(arrowId):setAngle(270)
	tutorial:getArrow(arrowId):show(0.25)
	tutorial:getArrow(arrowId):setShowTimer(0.5)
	tutorial:getArrow(arrowId):setScale(0.7)
end

function RE2A_09_05(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_09_05"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "FeatherGuy"

		DialogInit(levelId)
		DialogAddCharacterAtPositionAndOrientation(loc, IPoint(100, 450), false)
		
		DialogAddLua(function()
			RE2A_09_05_AddArrow(IPoint(505, 355))
			RE2A_09_05_AddArrow(IPoint(600, 340))
			RE2A_09_05_AddArrow(IPoint(682, 330))
			RE2A_09_05_AddArrow(IPoint(483, 268))
			RE2A_09_05_AddArrow(IPoint(582, 247))
			RE2A_09_05_AddArrow(IPoint(698, 239))
		end)
		DialogAddLine(loc, "RE2A_09_05_01")
		DialogAddLine(loc, "RE2A_09_05_02")
		DialogAddLua(function()
			tutorial:hideArrows(0.25)
		end)
		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_09_06(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_09_07_AddArrow(pos)
	local arrowId = tutorial:addArrow()
	tutorial:getArrow(arrowId):setPosition(pos.x, pos.y)
	tutorial:getArrow(arrowId):setAngle(270)
	tutorial:getArrow(arrowId):show(0.25)
	tutorial:getArrow(arrowId):setShowTimer(0.5)
end

function RE2A_09_07(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_09_07"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "FeatherGuy"

		DialogInit(levelId)
		DialogForbidRentGeneration()

		DialogAddCharacter(loc, LeftAvatarPosition)
		DialogAddLua(function()
			RE2A_09_07_AddArrow(IPoint(624, 678))
			RE2A_09_07_AddArrow(IPoint(777, 655))
			RE2A_09_07_AddArrow(IPoint(930, 632))
			RE2A_09_07_AddArrow(IPoint(908, 498))
		end)
		DialogAddLine(loc, "RE2A_09_07_01")
		DialogAddLine(loc, "RE2A_09_07_02")
		DialogAddLua(function()
			tutorial:hideArrows(0.25)
		end)
		DialogAllowRentGeneration()

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_10_01(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_10_01"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "LongNeck"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacterAtPositionAndOrientation(sed, IPoint(100, 150), false)
		DialogAddCharacterAtPositionAndOrientation(loc, IPoint(900, 150), true)
		DialogForbidRentGeneration()

		DialogAddLine(loc, "RE2A_10_01_01")
		DialogAddLine(sed, "RE2A_10_01_02")
		DialogAddLine(loc, "RE2A_10_01_03")
		DialogAddLine(sed, "RE2A_10_01_04")
		DialogAddLine(sed, "RE2A_10_01_05")
		DialogAllowRentGeneration()

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_10_02(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_10_03(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_10_04(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_10_05(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
		ShowFAN()
	end
end

function RE2A_10_06(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_10_06"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "LongNeck"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacterAtPositionAndOrientation(sed, IPoint(100, 200), false)
		DialogAddCharacterAtPositionAndOrientation(loc, IPoint(900, 200), true)
		DialogForbidRentGeneration()
		
		DialogAddLua(function()
			tutorial:targetAll(tutorial:collectAllBuildingsWithType("Circus"), "RE2A_10_06_Circus", 0.5, IPoint(3, 65), 0.5)
		end)
		DialogAddLine(loc, "RE2A_10_06_01")
		DialogAddLine(loc, "RE2A_10_06_02")
		DialogAddLine(sed, "RE2A_10_06_03")
		DialogAddLua(function()
			tutorial:hideArrows(0.25)
		end)
		DialogAllowRentGeneration()

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end

function RE2A_10_07(message)
	if message:is("LoadLevel") then
		AddSmartHint("RE2A_YouDoNotNeedMoreThanOneBankHint")
		DialogOnLevelLoad()
	end

	local levelId = "RE2A_10_07"
	if message:is("LoadLevel") then
		if IsTutShowed(levelId) then
			DialogFinish()
			return
		end
		local loc = "LongNeck"
		local sed = "Sedrik"

		DialogInit(levelId)
		DialogAddCharacter(sed, LeftAvatarPosition)
		DialogAddCharacter(loc, RightAvatarPosition)
		DialogForbidRentGeneration()

		DialogAddLua(function()
			local arrowId = tutorial:addArrow()
			tutorial:getArrow(arrowId):setPosition(560, 670)
			tutorial:getArrow(arrowId):setAngle(270)
			tutorial:getArrow(arrowId):show(0.5)
		end)
		DialogAddLine(loc, "RE2A_10_07_01")
		DialogAddLine(loc, "RE2A_10_07_02")
		DialogAddLine(sed, "RE2A_10_07_03")
		DialogAddLua(function()
			tutorial:hideArrows(0.25)
		end)
		DialogAllowRentGeneration()

		DialogStart()
	end

	if not IsTutShowed(levelId) then
		DialogProcessMessage(message)
	end
end