challenge CREATURE_DEVELOPMENT
run script CreatureDevLeashPickup

begin script CreatureDevLeashPickup
	MyCreaturePos = marker at [1896.4113, 18.0900, 2527.4729]
	TrainerPos = marker at [1887.0200, 28.1400, 2625.7800]
	MyCreature = get player 1 creature
	Trainer = create VILLAGER MALE at [TrainerPos]
	Highlight=0
	Rope = marker at [1896.4113, 18.0900, 2527.4729] // TODO: should be pos of Rope Icon.
	CamPos = marker at [1894.2354, 28.8333, 2508.1797]
	CamFocus = marker at [1915.0500, 18.0900, 2508.8899]
	CitadelEntrancePos = marker at [1906.8438, 18.0900, 2514.3760]
//	Cow = create ANIMAL_INFO_COW SCRIPT_OBJECT_TYPE_ANIMAL at [1878.6301, 28.1400, 2630.9177]
	Cow = create ANIMAL BOVINE at [1878.6301, 28.1400, 2630.9177]
	DroppedObject = 0
start
	disable Trainer moveable
	disable Trainer pickup
	Highlight = create highlight HIGHLIGHT_QUEST at [Trainer]
	run script CreatureDevelopmentHighlightNotify(Highlight, Trainer, 100, variable GOOD_ADVISOR, variable HELP_TEXT_GENERAL_CHALLENGE_START_01)
	move MyCreature position to [MyCreaturePos]	
	begin cinema
		// First of all, look at the Trainer
		set camera position to [Trainer]+[20, 0, 20] // TODO: nice camera paths
		set camera focus to [Trainer]	// TODO: nice camera paths
		set Trainer focus to [Trainer]+[20, 0, 20] // TODO: nice paths
		Trainer play ANM_P_BECKON loop 1
		wait until Trainer played
		Trainer play ANM_P_INTO_POINTING loop 1
		wait until Trainer played
		Trainer play ANM_P_TALKING_AND_POINTING loop 1
		wait until Trainer played
		Trainer play ANM_P_OUT_OF_POINTING loop 1
		wait until Trainer played
		say "You can use the leash to direct your creature towards objects"
		wait until read
		set Trainer focus to [Cow]
		say "You see that cow over here"
		Trainer play ANM_P_INTO_POINTING loop 1
		wait until Trainer played
		wait until read
		Trainer play ANM_P_TALKING_AND_POINTING loop 1
		wait until Trainer played
		Trainer play ANM_P_OUT_OF_POINTING loop 1
		wait until Trainer played
		say "If you move your hand over the cow with the leash on, the creature will pick it up"
		set Trainer focus to [MyCreature]
		release MyCreature
		set MyCreature only desire CREATURE_DESIRE_CURIOSITY
		wait until Trainer played
		Trainer play ANM_P_INTO_POINTING loop 1
		say "Get your creature to pick up this cow"
		wait until Trainer played
		Trainer play ANM_P_TALKING_AND_POINTING loop 1
		wait until Trainer played
		wait until read
		Trainer play ANM_P_OUT_OF_POINTING loop 1
		wait until Trainer played
	end cinema
	DroppedObject = get dropped by MyCreature
	while not DroppedObject exists or not DroppedObject == Cow
		DroppedObject = get dropped by MyCreature // TODO: should be "get held by MyCreature" but there is no function for that yet"
		set MyCreature only desire CREATURE_DESIRE_CURIOSITY
	end while
	begin cinema
		set camera position to [Trainer]+[10,0,10] // TODO: nice camera paths
		set camera focus to [Trainer]	// TODO: nice camera paths
		set Trainer focus to [MyCreature]
		wait until Trainer played
		Trainer play ANM_P_CROWD_IMPRESSED_1 loop 1
		say "Well done. You see! The leash is very useful."
		wait until Trainer played
	end cinema
	delete Trainer
	if Cow exists
		delete Cow
	end if
end script CreatureDevLeashPickup
