function setDinarForShot()
   char_tailor:setConfiguration("cfg_char_bazar_screenshot1")
   char_tailor:blendTo("dinar_pose")
end

Demo = {}

function Demo:showExtroImage()
   local extro = GUIWindowMgr:getGUIWindow("Ankh/DemoEnd")
   extro:setVisible(true)
   extro:setAlpha(0.0)
   extro:animateAlpha(0.0,1.0,1.0)
   api:callDelayed("Demo:setAlphaFull",1.1)
   Ankh:mdisconnect()
end

function Demo:setAlphaFull()
   local extro = GUIWindowMgr:getGUIWindow("Ankh/DemoEnd")
   extro:setAlpha(1.0)
   extro:setVisible(true)
end

function showShadowTexture()
   local overlay = GUIWindowMgr:createOverlay2D("ankh_shadow_texture")
   overlay:setVisible(true)
end

function startQuestGardenBakery()
   CrocMask:activate()
   CrocMask.quest:setDone("SpokenWithNubian")
   CrocMask.quest:setDone("NubianPaid")
   CrocMask.quest:setDone("FerryPimped")
   CrocMask.quest:setDone("CompassFixed")
   char_nubian:setConfiguration("CrocMask_char_nubian_desert_beach")
   animobj_bazar_ferry:setConfiguration("cfg_animobj_bazar_ferry_desert_beach")
   iactor_desert_beach_to_desert_crossing:setConfiguration("CrocMask_CompassFixed_iactor_desert_beach_to_desert_crossing")
   Oasis.quest:setDone("TreasureMapTaken")
   Inventory:addItemSafely("item_bottle_empty")
   LocationMgr:changeCameraAndOrLocation("palace_garden","cam_palace_garden_bakery_lower",PinaVector3(1365,210,2885),Rotate(Degree(0),Degree(270),Degree(0)),"default")
   GardenBakery:activate()
   Ankh:mconnect()
end

function startQuestGarden()
   GardenBakery:activate()
   Garden:activate()
   LocationMgr:changeCameraAndOrLocation("palace_garden","cam_palace_garden_gallery_a_entrance",PinaVector3(1246,652,3700),Rotate(Degree(0),Degree(0),Degree(0)),"palace_garden_gallery_a_pathnodes")
   Ankh:mconnect()
end

function startQuestRitual()
   Ritual:activate()
   LocationMgr:changeCameraAndOrLocation("palace_temple","cam_palace_temple_gallery",PinaVector3(1665,0,235),Rotate(Degree(0),Degree(180),Degree(0)),"default")
   Ankh:mconnect()
end

function startQuestCrocMask()
   LocationMgr:changeCameraAndOrLocation("ship_wreck","cam_ship_wreck_a",PinaVector3(0,294,424),Rotate(Degree(0),Degree(180),Degree(0)),"default")
   CrocMask:activate()
   CrocMask:setUnderwaterSpeed()
   Ankh:mconnect()
end

function startGiza()
   LocationMgr:changeCameraAndOrLocation("giza","cam_giza_main",PinaVector3(-517,276,381),Rotate(Degree(0),Degree(180),Degree(0)),"default")
   Oasis:activate()
   Ankh:mconnect()
end

function startOasis()
   LocationMgr:changeCameraAndOrLocation("oasis","cam_oasis_entrance",PinaVector3(-517,276,381),Rotate(Degree(0),Degree(180),Degree(0)),"default")
   Oasis:activate()
   Ankh:mconnect()
end

function startSunOfCairo()
   SunOfCairo:activate()
   CrocMask:activate()
   CrocMask.quest:setDone("SpokenWithNubian")
   CrocMask.quest:setDone("NubianPaid")
   CrocMask.quest:setDone("FerryPimped")
   CrocMask.quest:setDone("FerryTakenToBazar")
   CrocMask.quest:setDone("CompassFixed")
   iactor_desert_beach_to_desert_crossing:setConfiguration("CrocMask_CompassFixed_iactor_desert_beach_to_desert_crossing")
--   Oasis:activate()
   Oasis.quest:setDone("TreasureMapTaken")
--   LocationMgr:changeCameraAndOrLocation("bazar","cam_bazar_stall",PinaVector3(861,1059,-4713),Rotate(Degree(0),Degree(0),Degree(0)),"default")
   Inventory:addItemSafely("item_bottle_empty")
   Ankh:mconnect()
end

function startQuestEscapePalace()
   Garden:activate()
   Garden.quest:setDone("DoorOpenerRightUsedAssil")
   Garden.quest:setDone("DoorOpenerRightUsedThara")
   Garden.quest:setDone("DoorOpenerLeftUsedAssil")
   Garden.quest:setDone("DoorOpenerLeftUsedThara")
   Garden.quest:setDone("DoorOpened")
   Ritual:activate()
   Ritual.quest:setDone("IntroDone")
   Ritual.quest:setDone("QuestSolved")
   Ankh:hideCharSwitch()
   EscapePalace:activate()
end

function startNile()
   CrocMask:activate()
   CrocMask:startNileSequence()
   Ankh:mconnect()
end

function startQuestEmbassy()
   LocationMgr:changeCameraAndOrLocation("bazar","cam_bazar_stall",PinaVector3(861,1059,-4713),Rotate(Degree(0),Degree(0),Degree(0)),"default")
   Embassy:activate()
   Ankh:mconnect()
end

function startQuestSphinx()
   Sphinx:activate()
   CrocMask:activate()
   CrocMask.quest:setDone("SpokenWithNubian")
   CrocMask.quest:setDone("NubianPaid")
   CrocMask.quest:setDone("FerryPimped")
   CrocMask.quest:setDone("FerryTakenToDesert")
   CrocMask.quest:setDone("CompassFixed")
   char_nubian:setConfiguration("CrocMask_char_nubian_desert_beach")
   animobj_bazar_ferry:setConfiguration("cfg_animobj_bazar_ferry_desert_beach")
   iactor_desert_beach_to_desert_crossing:setConfiguration("CrocMask_CompassFixed_iactor_desert_beach_to_desert_crossing")
   Oasis.quest:setDone("TreasureMapTaken")
   LocationMgr:changeCameraAndOrLocation("sphinx_inside","cam_sphinx_inside_body_ground",PinaVector3(1435,0,885),Rotate(Degree(0),Degree(-54),Degree(0)),"default")
   Inventory:addItemSafely("item_bucket_red")
   Inventory:addItemSafely("item_time_machine_broken")
   Inventory:addItemSafely("item_sphinx_key")
   Ankh:mconnect()
end

function startQuestSphinx2()
   SunOfCairo.quest:setDone("IntroDone")
   SunOfCairo:activate()
   Sphinx:activate()
   CrocMask:activate()
   CrocMask.quest:setDone("SpokenWithNubian")
   CrocMask.quest:setDone("NubianPaid")
   CrocMask.quest:setDone("FerryPimped")
   CrocMask.quest:setDone("CompassFixed")
   char_nubian:setConfiguration("CrocMask_char_nubian_desert_beach")
   animobj_bazar_ferry:setConfiguration("cfg_animobj_bazar_ferry_desert_beach")
   iactor_desert_beach_to_desert_crossing:setConfiguration("CrocMask_CompassFixed_iactor_desert_beach_to_desert_crossing")
   Oasis.quest:setDone("TreasureMapTaken")
   LocationMgr:changeCameraAndOrLocation("sphinx_outside","cam_sphinx_outside_sphinx",PinaVector3(-823,77,326),Rotate(Degree(0),Degree(275),Degree(0)),"default")
   Inventory:addItemSafely("item_bucket_red")
   Inventory:addItemSafely("item_time_machine_broken")
   Inventory:addItemSafely("item_sphinx_key")
   Ankh:mconnect()
end

function startUnderworld()
   EnterUnderworld:activate()
   Osiris:activate()
   give("tiara_emerald")
   LocationMgr:changeCameraAndOrLocation("underworld","cam_underworld_entrance_a",PinaVector3(-4636,4295,-295),Rotate(Degree(0),Degree(0),Degree(0)),"default")
end

-- debug helper 
function setFarClip(p_Distance)
   CameraMgr:setFarClipDistance(CameraMgr:getActiveCameraName(),p_Distance)
end
