Quest: Lost in the Sand

__TOC__
This is the wiki page for the main story quest " Lost in the Sand"
It contains spoilers.
The page is currently WIP.
=== Walkthrough (Spoiler Alert!) ===
Content
After you arrive in Egypt, you can find a tent that was previously not there in the Desert of Trapped.
After you get into the tent, you will find another organization is also looking for the missing professors.
A man who looks like their leader invites you to have a meeting in the Tea House of Baldat'Aten'Almaleuna
Talk to Karaduman in the Tea House of Baldat'Aten'Almaleuna.
After exchanging information he will head to the library and suggest you go there too.
Go to the Grand Library. Go to any other floor through the teleport circle and come back. You will find a conflict between the Templars and the Illuminati breaks out. They are locked in a funny stalemate while you can take your time to explore the library and find a way to get through the Desert of the Trapped.
Go back to the Floor of Religion, defeat the sloth demon, and find a mercenary with the book you are looking for.
Either give him 2 Butterfly Wings or just kill them to get the book.
You will find the book is encrypted. Both Eve and Karaduman will appear offering to decrypt the book for you. You can choose: A, Work with the Illuminati. B, Work with the Templars. C, Work with neither of them. D. Convince them to work together. (If you have a good relationship with both of them.)
After you made your choice, they will return to the tea house. Unless you decide to work alone, they will also temporally take the book.
When you get back to the tea house. A messenger sends you a message. Someone is asking to meet you in the nearby abandoned house.
Visit the Abandoned House, and go deep inside to trigger the story event. Depending on your previous actions different dialogs may play.
Go to the Branched Ancient Tomb and inspect the sarcophagus. You get a feeling that it's connected with the encrypted books. (At this step, your allies shall have finished decrypting the book. If you chose to decrypt it by yourself. You may be able to decrypt it earlier.)
Use whatever methods to decrypt the book, use the decrypted book to perform the ritual near the sarcophagus in the Branched Ancient Tomb. The story will play, and a portal will open.
Get across the portal you will arrive at Somewhere in Between. Some short story content will automatically start.
Get through the otherworldly Desert of the Trapped, you will reach the Path to the Black Pyramid. Harold will mention that time and space follow different laws in this place.
On the Path to the Black Pyramid, you will witness the Aten Priest execute some adventurers with sandworms
Reach the outside of the Balck Pyramid area, you will encounter a defense force of the Aten Cultists. Depending on your previous actions, the story will become a bit different from here.
If you have no other factions as your allies, you must break through by yourself.
If you previously decided to ally with the Templars, they will come to your aid and use their Holy Handgrenades to break the defense of the Aten Cultists. They also brought in free healing services.
If you previously decided to ally with the Illuminati, they will come to your aid and use superior firepower, including calling for fire support from a HIMARS to annihilate the defense of the Aten Cultists. They also brought in a Quartermaster robot that can sell your medical supplies, ammo, and some guns. Eve would also appear. You can ask her about the HIMARS, give her the bunny if you previously didn't, and give her gifts. 
If you previously convinced both the Templars and the Illuminati to work together, they will both come to your aid. An argument will break out between those two factions.
Go to the Sphinx in this area, the girl previously you met in the Brenched Ancient Tomb appears. She asks you to take a test.
Agree and you will start a boss fight with the Sphinx. However, the Sphinx just plays riddles with you. The fight can be easily passed if you can answer all riddles correctly.
The girl will complain the Sphinx didn't fight hard enough. Nevertheless, she allows you to pass.
Get inside the Sphinx (or technically beneath it), you can find an instruction on how to open the gate of the Pyramid near an altar.
Find an obelisk on the hill located on the left side of the "Outside the Black Pyramid" area. Do what the instruction has told. The gate of the pyramid shall open.
At the entrance of the Black Pyramid, the girl you previously met in the Branched Ancient Tomb will appear again and reveal her identity. She will ask you for a favor. You can either agree or refuse.
Inside the Black Pyramid, you will face the Royal Guard Captain. You can go directly to fight and defeat him. Alternatively, you can show him that his faith has been twisted. (It requires you to have read Akhenaten's Journal) If you convinced him to not fight you, he will give you his weapon with 4 prefixes.
Go through the gate behind the Royal Guard Captain, shade will try to contact you.
This room is the last safe location before the final battle of this quest. It may also be a point of no return depending on your choices. Thus, you may want to save and rest here.
You will get a warning about this may be the point of no return before entering the high priest's lab.
The story of the final confrontation will start automatically once you enter the room.
After you defeat the high priest in battles, he will retreat to the second floor of his lab. Follow him.
With your allies arriving and the high priest betrayed by someone, he is defeated. You will need to choice kill him or capture him. The outcome will play accordingly.
Return to the safehouse and report back to Captain Nameless.
The mission will complete and the next chapter "The Anomalous Nation" will start.
=== Details of the Final Battles ===
At the very end of this mission there are a sequence of battle that will happen.
Here are the details:
Spoiler Alert!
Sequence	Enemy 	Note
1 	2 Combat Robots 	They have more HP than usual combat robots enemies.
2 	4 shaded slaves 	They have better attributions than their normal counterparts.
3 	Ancient Sandworm + Aten High Priest (Human)	The ancient sandworm will summon smaller sandworms.
There is no additional attribution to this ancient sandworm than its normal counterparts.
Aten High Priest will revive and heal the ancient sandworm whenever he thinks it necesary.
4 	Aten High Priest (Shade Infected) 	He can summon shades every few turns.
He takes two actions each turn, focusing on either dealing damage, applying negative effects, or condemning and smiting you.
Once his HP goes down below 40% of his max HP. He will start to channel shade power.
If he is not defeated within the next 5 turns, he will cast a "wave of extinct" with extremely high damage to wipe out your group.
You can survive the "wave of extinct' by some methods such as "immutable."
However, he will continue to cast the "wave of extinct" every turn afterward.
TBC 	 	
=== Tech Stuffs ===
Trigger 	Condition 	Variable Change	Note
Initialize 	Finish the quest: Sins of the Father	700 	Here it begins.
Enter the Expedition Team's Tent 	V801 == 700 	V801 = 705 	
Talk to Karaduman in the Tea House of Baldat'Aten'Almaleuna. 	V801 == 705 	V801 = 710 	
Go to any other floors of the Grand Library 	V801 == 710 	V801 = 715 	
Return to the Floor of General Works 	V801 = 715 	V801 = 720 	Either by the teleport circle or Butterfly Wings
Automatically Start at the Floor of General Works 	V801 = 720 	V801 = 725 	
Deal with the mercenary on the Floor of Religion 	V801 = 725 	V801 = 740 	There are 2 ways to solve the mercenary problem.
Choose your ally 	V801 = 740 	V801 = 750
$s_gmess["core_LostInTheSandAlly"] value set	4 possible outcomes. See above.
Receive the message in the Tea House 	V801 = 750 	V801 = 755 	Your teammates may have additional dialog if they are in the group.
Visit the Abandoned House and trigger the event there 	V801 = 755 	V801 = 780 	Depending on your previous actions, dialogs may be different.
Check the sarcophagus in the Branched Ancient Tomb 	V801 = 780 	V801 = 785 	
Use the decrypted book near the sarcophagus in the Branched Ancient Tomb.	Does not matter 	V801 = 800 	
Cross the portal in the Branched Ancient Tomb 	V801 = 800 	V801 = 815 	At this step, Eve and Karaduman will leave the tea house.
Reach the Desert of the Trapped in anther world 	V801 = 815 	V801 = 820 	
Reach the Path to the Black Pyramid 	V801 = 820 	V801 = 825 	
When going through the Path to the Black Pyramid 	V801 = 825 	V801 = 850 	
Get through the defense outside the Black Pyramid 	V801 = 850 	V801 = 930 	Progression details will be different on different paths.
Talk to the girl in front of the Sphinx 	Does not matter 	V801 = 935 	
Defeat the Sphinx 	V801 = 935 	V801 = 945 	
Get inside the secret room beneath the Sphnix 	V801 = 945 	V801 = 950 	
Find the instruction and open the gate of the Black Pyramid 	Does not matter 	V801 = 960 	
Agree or refuse Meketaten's request before entering the Black Pyramid. 	V801 = 960 	V801 = 970 	
Enter the Black Pyramid 	V801 = 970 	V801 = 975 	Mission log updates
Complete the encounter with the Royal Guard Captin 	Does not matter 	V801 = 1000 	Two possible ways to solve this.
Go through the gate behind the Royal Guard Captain 	V801 = 1000 	V801 = 1010 	
Reach the high priest's lab 	V801 = 1010 	V801 = 1060 	
Get close to the high priest after he retreats to the 2nd floor.
You will make the choice to capture or kill him.	V801 = 1060 	V801 = 1300