------------------------------------------------Variables------------------------------------------------

require( "package/quests/q_variables_define.lua" );
DebugOut( "Collection quest (file : package/quests/q_tutorial_callbacks.lua)" );

------------------------------------------------------------------------------------------------

--Dernier callback conditionnant l'affichage des aides non primordiales.
Last_Linear_Callback = "TUTO_end";

-----------------------------------------------------------------------------------------------------
-------------------------------Callbacks Primaires dans l'ordre------------------------------------
-----------------------------------------------------------------------------------------------------

--deplacement de la fee qque part sur l'ecran (coordonnées selon le milieu de l'ecran )
--SetFaeryPositionScreen( x, y, speed, callback )

--desactiver le deplacement auto de la fée + le deplacement quand la souris passe dessus
--SetFaeryWait( true )
--(reactiver : SetFaeryWait( false )

--Faire bouger la camera ( coordonnées de map, comme un viewpoint quoi ) => empeche la fee de bouger et set son anim pour donner l'impression qu'elle se deplace avec l'ecran (la fee reprend son mouvement une fois la camera stabilisée)
--MoveCamera( x, y, speed, callback )

-----------------------------------------------------------------------------------------------------
-------------------------------INTRO------------------------------------
-----------------------------------------------------------------------------------------------------

function F_Tuto_Enable_Input()
	DisableInput(false);
end

function F_Tuto_Disable_Input()
	DisableInput(true);
end

function F_Tuto_Pop_Task()
	PopFrontTask();
end

function F_tuto_init()
	SetQuestElementActivated("Q_verb_crystal_learning",false);
	SetQuestElementActivated("Q_legendary_melody_muse_playing",false);
	SetQuestElementActivated("Q_mirror_b_cleaning",false);
	SetQuestElementActivated("Q_mirror_e_cleaning",false);
	SetQuestElementActivated("Q_mirror_f_cleaning",false);
	SetQuestElementActivated("Q_compass_cleaning",false);
	SetQuestElementActivated("Q_exploration_training",false);
	SetQuestElementActivated("Q_theater_playing",false);
	SetQuestElementActivated("Q_eating",false);
	SetQuestElementActivated("Q_hermit_seed_dropped_going",false);
	SetQuestElementActivated(G_hermit_faery,false);
	SetQuestElementActivated(G_banquet_play,false);
	SetQuestElementActivated(G_banquet_cook,false);
	SetQuestElementActivated(G_banquet_brew,false);
	SetQuestElementActivated(G_nature_training,false);
	SetQuestElementActivated("Q_garden_seed_growing",false);
	SetQuestElementActivated("Q_mill_fixing",false);
	SetQuestElementActivated("Q_mirror_d_cleaning",false);
	SetQuestElementActivated("Q_world_history_tree_runes_learning",false);
	SetQuestElementActivated("Q_alambic_fixing",false);
	SetFlagsMapVisible( "Flag_Exploration", false)
	SetFlagsMapVisible( "Flag_Musique", false)
	SetFlagsMapVisible( "Flag_Nature", false)
	SetFlagsMapVisible( "Flag_Savoir", false)
end

function F_linear_tuto_go()
	F_tuto_init();
	DisplayTutorialCallback("TUTO_game_start");
end

function F_linear_tuto_go_no_choice()
	F_tuto_init();
	F_Tuto_Fade_Tree();
end

function F_linear_tuto_negative_aswer()
	DisplayInformation( "TUTO_start_negative_answer", "backgrounds/dialog/vignette_fee", "", 0, "F_linear_tuto_no", true );
end
function F_linear_tuto_no()
	CompleteAllLinearTutorialCallbacks();
	SetFlagsMapVisible( "Flag_Exploration", false)
	SetFlagsMapVisible( "Flag_Musique", false)
	SetFlagsMapVisible( "Flag_Nature", false)
	SetFlagsMapVisible( "Flag_Savoir", false)
	SetFading("FO_tree",true);
	SetFading("FO_tree_left",true);
	SetFading("FO_tree_right",true);
	--ACHTUNG !!!! Boutons réactivés au début du fade = source de problèmes
	F_Tuto_End();
end

function F_Tuto_Intro()
	DisplayChoiceWindow( "TUTO_start_question", "backgrounds/dialog/vignette_fee", "F_linear_tuto_go", "F_linear_tuto_negative_aswer",true )
end

function F_tuto_start()
	DisplayInformation( "TUTO_begin_no_choice", "backgrounds/dialog/vignette_fee", "", 0, "F_linear_tuto_go_no_choice", true );
end



TutorialCallback
{
	name = "TUTO_game_start",
	--prerequisites = {},
	faery_window = true;
	callback_end = "F_Tuto_Fade_Tree";
	
	linear = true,
}

function F_Tuto_Fade_Tree()
	SetFading("FO_tree",true);
	SetFading("FO_tree_left",true);
	SetFading("FO_tree_right",true);
end

function F_Tuto_Move_To_Muse()
	if( IsGameInLinearTuto() ) then
		MoveCamera(-200.000000, 590.000000, G_tutorial_camera_speed,"F_Tuto_Selection_Intro");
	else
		DisableInput(false);
		DisableMapNavigation(false);
		SetFaeryWait(false);

		SetButtonHUDActivated(true);
		SetFeeButtonActivated(true);
		SetMapButtonActivated(true);
		SetTomeButtonActivated(true);
		SetShopButtonActivated(true);
		--SetSpeedButtonActivated(true);
		SetChienButtonActivated(true);			
		
		SetCollectionEnabled(true);
		
		SetSpiritImmunization(false);
		DisableAIForAllCharacters(false);
		DisableAIForLabrador(false);
	end
end

-----------------------------------------------------------------------------------------------------
-------------------------------SELECTION PERSONNAGE------------------------------------
-----------------------------------------------------------------------------------------------------

function F_Tuto_Selection_Intro()
	DisplayInformation( "TUTO_click_villager_intro", "backgrounds/dialog/vignette_fee", "", 0, "F_Tuto_Selection_Intro_next", true );
end

function F_Tuto_Selection_Intro_next()
	DisplayInformation( "TUTO_click_villager_intro_next", "backgrounds/dialog/vignette_fee", "", 0, "F_Tuto_Give_Select_Task", true );
end

function F_Tuto_Give_Select_Task()
	PushFrontTask( "TASK_click_villager", "TASK_click_villager" );
	SetDraggable("gnome_name_1",false);
	DisableInput(false);
end

TutorialCallback
{
	name = "TUTO_click_villager",
	has_next_action = true,
	-- prerequisites = { "TUTO_game_start" },
	faery_window = true,
	callback_begin = "F_Tuto_Crystal_Highlight",
	callback_end = "F_Tuto_Click_Villager_end",
	move_camera = false,
	
	linear = true,
}

-----------------------------------------------------------------------------------------------------
-------------------------------DRAG & DROP CRYSTAL------------------------------------
-----------------------------------------------------------------------------------------------------


function F_Tuto_Crystal_Highlight()
	PopFrontTask();
	DisableInput(true);
	SetFaeryPositionScreen( -150, 290, G_tutorial_fairy_speed, "F_Tuto_fairy_show_caracs" );
	PlayFX(Air, G_tutorial_FX, "LD_verb_crystal", 0, 0);
	SetQuestElementActivated("Q_verb_crystal_learning",true);
	SetDraggable("gnome_name_1",true);
	return true;
end

function F_Tuto_fairy_show_caracs()
	SetFaeryPositionScreen( 310, 290, G_tutorial_fairy_speed/3, "" );
end

function F_Tuto_Click_Villager_end()
	DisableInput(false);
	SetFaeryPositionScreen( -380, -165, G_tutorial_fairy_speed, "" );
	PushFrontTask( "TASK_drop_villager", "TASK_drop_villager" );
	SetTutorialDrop( "LD_verb_crystal", "TUTO_crystal_drop_fail" );
end



function F_Tuto_Disable_Crystal_Highlight()
	PopFrontTask();
	KillFX(Air, G_tutorial_FX, "LD_verb_crystal");
	DisableInput(true);
	SetTutorialDrop( "", "" );
	return true;
end

TutorialCallback
{
	name = "TUTO_drop_villager",
	-- has_next_action = true,
	prerequisites = { "TUTO_click_villager" },
	faery_window = true;
	callback_begin = "F_Tuto_Disable_Crystal_Highlight";
	-- callback_end = "F_Tuto_move_to_banquet_table";
	move_camera = false,
	
	linear = true,
}


-----------------------------------------------------------------------------------------------------
-------------------------------INTRO BANQUET------------------------------------
-----------------------------------------------------------------------------------------------------

function F_Tuto_move_to_banquet_table()
	-- PushFrontTask( "TASK_gather_food", "TASK_gather_food" );
	UnselectCurrent();
	SetFaeryPositionScreen( 0, -130, G_tutorial_fairy_speed, "" );
	MoveCamera(780.000000, 600.000000, G_tutorial_camera_speed,"F_Tuto_Banquet_Table_Intro");
	SetPositionToMove( "gnome_name_1", 857, 607, {}  );
	
end

function F_Tuto_Banquet_Table_Intro()
	DisplayInformation( "TUTO_banquet_table_intro", "backgrounds/dialog/vignette_fee", "", 0, "F_Tuto_Banquet_Table_Intro_End", true );
end

function F_Tuto_Banquet_Table_Intro_End()
	SetFaeryPositionScreen( 150, -200, G_tutorial_fairy_speed, "" );
	MoveCamera(1463.000000, 717.000000, G_tutorial_camera_speed,"F_Tuto_Fruits_Basket_Intro");
end

function F_Tuto_Fruits_Basket_Intro()
	DisplayTutorialCallback("TUTO_fruits_basket");
end

-----------------------------------------------------------------------------------------------------
-------------------------------DRAG & DROP ESPRIT------------------------------------
-----------------------------------------------------------------------------------------------------
function F_Tuto_fruits_basket_begin()
	SetPositionToMove( "pixies_name_1", 1038, 857, {}  );
	Select("pixies_name_1");
end

TutorialCallback
{
	name = "TUTO_fruits_basket",
	has_next_action = true,
	prerequisites = { "TUTO_drop_villager" },
	faery_window = true;
	callback_begin = "F_Tuto_fruits_basket_begin";
	callback_end = "F_tuto_fruits_basket_end";
	
	linear = true,
}
function F_tuto_fruits_basket_end()
	PushFrontTask( "TASK_spirit_drop", "TASK_spirit_drop" );
	F_Tuto_Enable_Input();
	SetFaeryWait(false);
	SetTutorialDrop( "Spirit", "TUTO_spirit_drop_fail" );
end

function F_Tuto_Spirit_Drop_Begin()
	SetTutorialDrop( "", "" );
	DisableInput(true);
	SetPickable("pixies_name_1",false);
	PopFrontTask();
	UnselectCurrent();
	Select("dryade_name_1");
	SetPositionToMove( "dryade_name_1", 1050, 750, {}  );
end

TutorialCallback
{
	name = "TUTO_spirit_drop",
	prerequisites = { "TUTO_fruits_basket" },
	callback_begin = "F_Tuto_Spirit_Drop_Begin",
	callback_end = "F_Tuto_Spirit_Drop_End",
	faery_window = true;
	move_camera = false,
	
	linear = true,
}

-----------------------------------------------------------------------------------------------------
-------------------------------DRAG & DROP BOUFFE------------------------------------
-----------------------------------------------------------------------------------------------------

function F_Tuto_Spirit_Drop_End()
	PushFrontTask( "TASK_dryade_drop", "TASK_dryade_drop" )
	PlayFX(Air, G_tutorial_FX, "LD_hermit_fairie", 0, 0);	
	SetQuestElementActivated(G_hermit_faery,true);
	DisableInput(false);
	SetTutorialDrop( "LD_hermit_fairie", "TUTO_food_drop_fail" );
end

function F_Tuto_Collect_Fruits_Begin()
	DisableInput(true);
	PopFrontTask();
	KillFX(Air, G_tutorial_FX, "LD_hermit_fairie");	
	SetTutorialDrop( "", "" );
end

TutorialCallback
{
	name = "TUTO_collect_fruits",
	prerequisites = { "TUTO_spirit_drop" },
	has_next_action = true,
	faery_window = true;
	move_camera = false,
	callback_begin = "F_Tuto_Collect_Fruits_Begin",
	callback_end = "F_Tuto_collect_fruits_end",
	
	linear = true,
}

function F_Tuto_collect_fruits_end()
	DisableInput(true);
end

TutorialCallback
{
	name = "TUTO_fruits_basket_end",
	prerequisites = { "TUTO_collect_fruits" },
	faery_window = true,
	move_camera = false,
	callback_begin = "F_Tuto_fruits_basket_end_begin",
	callback_end = "F_tuto_fruits_basket_end_end",
	
	linear = true,
}

function F_Tuto_fruits_basket_end_begin()
	F_Tuto_Pop_Task();
	SetFaeryWait(true);
	SetFaeryPositionScreen( 350, -100, G_tutorial_fairy_speed, "" );
	UnselectCurrent();
	
	SetPositionToMove( "pixies_name_1", 634, 592, {}  );
	SetPositionToMove( "dryade_name_1", 714, 600, {}  );
	SetPositionToMove( "gnome_name_1", 857, 607, {}  );
end

function F_tuto_fruits_basket_end_end()
	PushFrontTask( "TASK_prepare_banquet", "TASK_prepare_banquet" );
	SetFaeryPositionScreen( G_tutorial_fairy_default_position_x, G_tutorial_fairy_default_position_y, G_tutorial_fairy_speed, "" );
	MoveCamera(1000.000000, 600.000000, G_tutorial_camera_speed,"F_tuto_banquet_start");
	
end

-----------------------------------------------------------------------------------------------------
-------------------------------BANQUET------------------------------------
-----------------------------------------------------------------------------------------------------

function F_tuto_banquet_start()
	SetPickable("pixies_name_1",true);
	SetQuestElementActivated(G_banquet_play,true);
	SetQuestElementActivated(G_banquet_cook,true);
	SetQuestElementActivated(G_banquet_brew,true);
	PlayFX(Air, G_tutorial_FX, "LD_banquet_dispatch", 0, 0);
	SetTutorialDrop( "LD_banquet_dispatch", "TUTO_banquet_drop_fail" );
	DisplayTutorialCallback("TUTO_banquet");
end

TutorialCallback
{
	name = "TUTO_banquet",
	prerequisites = { "TUTO_fruits_basket_end" },
	faery_window = true,
	callback_end = "F_Tuto_Banquet_end",
	move_camera = false,
	
	linear = true,
}

function F_Tuto_Banquet_end()
	SetFaeryWait(false);
	DisableInput(false);
end


function F_Tuto_Recruit_Begin()
	SetTutorialDrop( "", "" );
	DisableAIForAllCharacters(true); -- Parce que sinon le Farfadet qui vient d'arriver fait ce qu'il veut.
	PopFrontTask();
	DisableInput(true);
	SetFaeryWait(true);
	SetFaeryPositionScreen( -380, 250, G_tutorial_fairy_speed, "" );
	SetPositionToMove( "pixies_name_1", -800, 800, {} ); -- En avance, pour qu'il y arrive au bon moment
end

TutorialCallback
{
	name = "TUTO_recruit",
	has_next_action = true,
	prerequisites = { "TUTO_banquet" },
	faery_window = true,
	callback_begin = "F_Tuto_Recruit_Begin",
	callback_end = "F_Tuto_Recruit_End",
	
	linear = true,
}

function F_Tuto_Recruit_End()
	SetTomeButtonActivated(true);
	PushFrontTask("TASK_go_tome","TASK_go_tome");
	UnselectCurrent();
	HighlightButton("tome", true);
	SetLoopHighlightBestiary( true );
    SetQuestHighlightDesactivated(true);
    SetCollectionHighlightDesactivated(true);
    SetTreeHighlightDesactivated(true);
end


-----------------------------------------------------------------------------------------------------
-------------------------------TOME OF LORE------------------------------------
-----------------------------------------------------------------------------------------------------
function F_TUTO_Tome_of_lore_end_begin()
	PopFrontTask();
end

TutorialCallback
{
	name = "TUTO_Tome_of_lore_end",
	prerequisites = { "TUTO_recruit" },
	faery_window = true,
	callback_begin = "F_TUTO_Tome_of_lore_end_begin",
	callback_end = "F_TUTO_Tome_of_lore_end_end",
	
	linear = true,
}

function F_TUTO_Tome_of_lore_end_end()
	SetQuestElementActivated("Q_hermit_seed_dropped_going",true);
	MoveCamera(1463.000000, 717.000000, G_tutorial_camera_speed,"F_Tuto_Hermit_Seed_Intro");
	SetQuestElementActivated(G_banquet_play,false);
	SetQuestElementActivated(G_banquet_cook,false);
	SetQuestElementActivated(G_banquet_brew,false);
	SetLoopHighlightBestiary( false );
    SetQuestHighlightDesactivated(false);
    SetCollectionHighlightDesactivated(false);
    SetTreeHighlightDesactivated(false);
end

-----------------------------------------------------------------------------------------------------
-------------------------------GRAINE ERMITE------------------------------------
-----------------------------------------------------------------------------------------------------

function F_Tuto_Hermit_Seed_Intro()
	SetPositionToMove( "dryade_name_1", 1463, 717, {}  ); -- En avance, pour qu'il y arrive au bon moment
	SetFaeryWait(true);
	SetFaeryPositionScreen( 150, -200, G_tutorial_fairy_speed, "" );
	DisplayInformation( "TUTO_hermit_seed_intro", "backgrounds/dialog/vignette_fee","", 0, "F_Tuto_Hermit_Seed_Intro_Next", true );	
end

function F_Tuto_Hermit_Seed_Intro_Next()
	MoveCamera(1091.000000, -47.000000, G_tutorial_camera_speed,"F_Tuto_Hermit_Seed_Intro_End");
end

function F_Tuto_Hermit_Seed_Intro_End()
	SetFaeryPositionScreen( 0, -200, G_tutorial_fairy_speed, "" );
	DisplayInformation( "TUTO_hermit_seed_intro_next", "backgrounds/dialog/vignette_fee","", 0, "F_Tuto_Hermit_Seed_Start", true );	
end

function F_Tuto_Hermit_Seed_Start()
	PushFrontTask( "TASK_hermit_seed", "TASK_hermit_seed" );
	DisableMapNavigation(false);
	SetFaeryWait(false);
	DisableInput(false);
	SetTutorialDrop( "LD_hermit_seed_dropped", "TUTO_hermit_seed_drop_fail" );
	--  
end

TutorialCallback
{
	name = "TUTO_hermit_seed_cancel",
	prerequisites = { "TUTO_Tome_of_lore_end" },
	faery_window = true,
	linear = true,
}


-----------------------------------------------------------------------------------------------------
-------------------------------BOUTIQUE------------------------------------
-----------------------------------------------------------------------------------------------------
function F_Tuto_shop_new_object_begin()
	AIMoveLabrador( {x = -878, y = 793},"" ); -- En avance, pour qu'il y arrive au bon moment
	SetTutorialDrop( "", "" );
	PopFrontTask();
	DisableMapNavigation(true);
	DisableInput(true);
	SetFaeryWait(true);
	SetFaeryPositionScreen( 300, 250, G_tutorial_fairy_speed, "" );
end


TutorialCallback
{
	name = "TUTO_shop_new_object",
	prerequisites = { "TUTO_Tome_of_lore_end" },
	callback_begin = "F_Tuto_shop_new_object_begin",
	callback_end = "F_Tuto_shop_new_object_end",
	faery_window = true,
	
	linear = true,
}

function F_Tuto_shop_new_object_end()
	PushFrontTask("TASK_go_shop", "TASK_go_shop");
	SetShopButtonActivated(true);
	HighlightButton( "boutique", true );
end

TutorialCallback
{
	name = "TUTO_shop_welcome",
	has_next_action = true,
	use_checkbox = false,
	
	linear = true,
}

-----------------------------------------------------------------------------------------------------
-------------------------------CHIEN------------------------------------
-----------------------------------------------------------------------------------------------------

function F_Tuto_Dog_Bark_Highlight()
	PlaySound( "sounds/animaux/labrador/dog_call_01.ogg", false, FXSound, "id_labrador" );
	HighlightButton( "chien", true );
	return true;
end

function F_Tuto_Dog_Intro_Begin()
	PopFrontTask();
	F_Tuto_Dog_Bark_Highlight();
	SetFaeryPositionScreen( -380, 250, G_tutorial_fairy_speed, "" );
end

TutorialCallback
{
	name = "TUTO_dog_intro",
	prerequisites = { "TUTO_shop_new_object" },
	faery_window = true,
	callback_begin = "F_Tuto_Dog_Intro_Begin",
	callback_end = "F_Tuto_Dog_Intro_End",
	
	linear = true,
}

function F_Tuto_Dog_Intro_End()
	PushFrontTask("TASK_go_dog", "TASK_go_dog");
	SetChienButtonActivated(true);
	F_Tuto_Dog_Bark_Highlight();
	DisableMapNavigation(false);
end


function F_Tuto_Dog_Begin()
	PopFrontTask();
	DisableMapNavigation(true);
end

TutorialCallback
{
	name = "TUTO_dog",
	has_next_action = true,
	prerequisites = { "TUTO_dog_intro" },
	faery_window = true,
	callback_begin = "F_Tuto_Dog_Begin",
	callback_end = "F_Tuto_Dog_End",
	
	linear = true,
}

function F_Tuto_Dog_End()
	PushFrontTask("TASK_train_villager", "train villager");
	DisableMapNavigation(false);
	SetQuestElementActivated("Q_legendary_melody_muse_playing",true);
	SetTutorialDrop( "LD_muse", "TUTO_muse_drop_fail" );
	DisableInput(false);
	DisableAIForLabrador(false);
	SetFaeryPositionScreen( -380, -165, G_tutorial_fairy_speed, "" );
end

-----------------------------------------------------------------------------------------------------
-------------------------------APPRENTISSAGE------------------------------------
-----------------------------------------------------------------------------------------------------

function TUTO_training_zone_begin()
	SetTutorialDrop( "", "" );
	DisableInput(true)
end

TutorialCallback
{
	name = "TUTO_training_zone",
	faery_window = true,
	has_next_action = true,
	prerequisites = { "TUTO_dog" },
	callback_begin = "TUTO_training_zone_begin",
	callback_end = "TUTO_training_zone_end",
	linear = true,
}

function TUTO_training_zone_end()
	DisableInput(false)
	PushFrontTask("TASK_find_training_zones","TASK_find_training_zones")
	SetMapButtonActivated(true)
	HighlightButton("map", false)

	PlayFX(Air, "fx/fx_boutique_4.lua", "LD_nature_training", 0, 0)
	PlayFX(Air, "fx/fx_boutique_4.lua", "LD_knowledge_training", 0, 0)
	PlayFX(Air, "fx/fx_boutique_4.lua", "LD_music_training", 60, 30)
	PlayFX(Air, "fx/fx_boutique_4.lua", "LD_exploration_training", 0, 0)
	
	SetFirstClickable("LD_nature_training",true)
	SetFirstClickable("LD_knowledge_training",true)
	SetFirstClickable("LD_music_training",true)
	SetFirstClickable("LD_exploration_training",true)
	DisplayQuestElementInTome("Q_learning_zones_nature_finding",true)
	DisplayQuestElementInTome("Q_learning_zones_knowledge_finding",true)
	DisplayQuestElementInTome("Q_learning_zones_music_finding",true)
	DisplayQuestElementInTome("Q_learning_zones_exploration_finding",true)
end



-----------------------------------------------------------------------------------------------------
-------------------------------FIN DU TUTO------------------------------------
-----------------------------------------------------------------------------------------------------

TutorialCallback
{
	name = "TUTO_end",
	faery_window = true,
	has_next_action = true,
	prerequisites = { "TUTO_training_zone" },
	callback_end = "F_Tuto_End",
	
	linear = true,
}



TutorialCallback
{
	name = "TUTO_timetotime",
	faery_window = true,
	linear = true,
	-- RAJOUTER A LA FIN DU TUTORIAL
}

function F_Tuto_End()

	
	PushTask("TASK_find_tree_runes","TASK_find_tree_runes",-1)
	PushTask("TASK_decipher_tree_runes","TASK_decipher_tree_runes",0)
	SetFirstClickable("LD_tree_runes",true)
	PlayFX(Air, "fx/fx_boutique_4.lua", "LD_tree_runes", 0, 0)
	DisplayQuestElementInTome( "Q_world_history_tree_runes_learning", true )
	if not IsQuestCompleted("Q_learning_zones") then
		SetFirstClickable("LD_nature_training",true)
		SetFirstClickable("LD_knowledge_training",true)
		SetFirstClickable("LD_music_training",true)
		SetFirstClickable("LD_exploration_training",true)
		DisplayQuestElementInTome("Q_learning_zones_nature_finding",true)
		DisplayQuestElementInTome("Q_learning_zones_knowledge_finding",true)
		DisplayQuestElementInTome("Q_learning_zones_music_finding",true)
		DisplayQuestElementInTome("Q_learning_zones_exploration_finding",true)
	end

	DisableMapNavigation(false);
	SetFaeryWait(false);
	SetSpiritImmunization(false);
    SetButtonHUDActivated(true);
	DisableAIForAllCharacters(false);
	DisableAIForLabrador(false);
	
	SetQuestElementActivated("Q_world_history_tree_runes_learning",true);
	
	SetQuestElementActivated("Q_legendary_melody_muse_playing",true);
	SetQuestElementActivated("Q_mirror_b_cleaning",true);
	SetQuestElementActivated("Q_mirror_e_cleaning",true);
	SetQuestElementActivated("Q_mirror_f_cleaning",true);
	SetQuestElementActivated("Q_compass_cleaning",true);
	SetQuestElementActivated("Q_exploration_training",true);
	SetQuestElementActivated("Q_theater_playing",true);
	SetQuestElementActivated("Q_eating",true);
	SetQuestElementActivated(G_nature_training,true);
	SetQuestElementActivated("Q_garden_seed_growing",true);
	SetQuestElementActivated("Q_mill_fixing",true);
	SetQuestElementActivated("Q_mirror_d_cleaning",true);
	
	SetQuestElementActivated(G_banquet_play,true);
	SetQuestElementActivated(G_banquet_cook,true);
	SetQuestElementActivated(G_banquet_brew,true);
		SetQuestElementActivated("Q_alambic_fixing",true);
	SetCollectionEnabled(true);
	SetMapButtonActivated(true);
	
	SetButtonHUDActivated(true);
	SetFeeButtonActivated(true);
	SetTomeButtonActivated(true);
	SetSpeedButtonActivated(true);
	SetShopButtonActivated(true);
	SetChienButtonActivated(true);	
	
	DisplayTutorialCallback("TUTO_timetotime");
	
	SetInLinearTutorial( false );
	SetFirstClickable("LD_ruins_hand",true)
	SetFirstClickable("LD_compass",true)
	SetFirstClickable("LD_broken_mill",true)
	
	SetFirstClickable("LD_mirror_A_cleaning",true)
	SetFirstClickable("LD_mirror_B_cleaning",true)
	SetFirstClickable("LD_mirror_C_cleaning",true)
	SetFirstClickable("LD_mirror_D_cleaning",true)
	SetFirstClickable("LD_mirror_E_cleaning",true)
	SetFirstClickable("LD_mirror_F_cleaning",true)
	
	SetFirstClickable( "Sage", false )
	
	Save();
	
end

-----------------------------------------------------------------------------------------------------
------------------------------------------Callbacks sans prérequis---------------------------------
-----------------------------------------------------------------------------------------------------



TutorialCallback
{
	name = "TUTO_tome_welcome",
	use_checkbox = false,
}

TutorialCallback
{
	name = "TUTO_knowledge_tree_welcome",
	use_checkbox = false,
}

TutorialCallback
{
	name = "TUTO_tome_collection_welcome",
	use_checkbox = false,
}

TutorialCallback
{
	name = "TUTO_tome_bestiary",
	use_checkbox = false,
}

TutorialCallback
{
	name = "TUTO_tome_quest",
	use_checkbox = false,
}

TutorialCallback
{
	name = "TUTO_map",
	use_checkbox = false,
}

TutorialCallback
{
	name = "TUTO_speed",
	use_checkbox = false,
	callback_end = "F_speed_window",
  ignore_other = true,
}

function F_speed_window()
	gTempFunction = 
		function() 
			DoModal("scripts/speed.lua");
		end;
	table.insert( gCommandQueue,gTempFunction );	
end

-----------------------------------------------------------------------------------------------------
---------------------------------------------- Callbacks Secondaires --------------------------------
-----------------------------------------------------------------------------------------------------
TutorialCallback
{
	name = "TUTO_fear",
	faery_window = true,
	prerequisites = { Last_Linear_Callback },
}

TutorialCallback
{
	name = "TUTO_faerie_gain",
	faery_window = true,
	prerequisites = { Last_Linear_Callback },
	callback_end = "F_Tuto_tome_highlight",
}

TutorialCallback
{
	name = "TUTO_hunger",
	faery_window = true,
	prerequisites = { Last_Linear_Callback },
}

TutorialCallback
{
	name = "TUTO_recolt",
	faery_window = true,
	prerequisites = { Last_Linear_Callback },
}

TutorialCallback
{
	name = "TUTO_visual_pop_check",
	faery_window = true,
	prerequisites = { Last_Linear_Callback },
}

TutorialCallback
{
	name = "TUTO_tome_tree_buy",
	faery_window = true,
	prerequisites = { Last_Linear_Callback },
	callback_end = "F_Tuto_tome_highlight",
}

function F_Tuto_tome_highlight()
	HighlightButton( "tome", false );
end

TutorialCallback
{
	name = "TUTO_tome_collection_take",
	faery_window = true,
	prerequisites = { Last_Linear_Callback },
}

TutorialCallback
{
	name = "TUTO_visual_work_check",
	faery_window = true,
	prerequisites = { Last_Linear_Callback },
}

TutorialCallback
{
	name = "TUTO_visual_action",
	faery_window = true,
	prerequisites = { Last_Linear_Callback },
}

TutorialCallback
{
	name = "TUTO_visual_tome_check",
	faery_window = true,
	prerequisites = { Last_Linear_Callback },
	callback_end = "F_Tuto_tome_highlight",
}

-----------------------------------------------------------------------------------------------------
---------------------------------------------- Callbacks Tertiaires ---------------------------------
-----------------------------------------------------------------------------------------------------


TutorialCallback
{
	name = "TUTO_lvl_gain",
	faery_window = true,
	prerequisites = { Last_Linear_Callback },
}



----------------------- Callbacks à virer ---------------------
TutorialCallback -- Utilisé pour shunter les callbacks à virer.
{
	name = "TUTO_dummy",
	faery_window = true;
}



