class 1 falsepriest_dominic : citizen
{
handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,21) == 1 && myself::GetMemoState(talker,21) == 7 && myself::OwnItemCount(talker,7140) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Hidden Truth (Continue)");
			}
			if( myself::HaveMemo(talker,21) == 1 && myself::GetMemoState(talker,21) == 8 && myself::OwnItemCount(talker,7140) >= 1 && ( myself::GetMemoStateEx(talker,21,1) == 1 || myself::GetMemoStateEx(talker,21,1) == 2 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Hidden Truth (Continue)");
			}
			if( myself::HaveMemo(talker,21) == 1 && myself::GetMemoState(talker,21) == 8 && myself::OwnItemCount(talker,7140) >= 1 && myself::GetMemoStateEx(talker,21,1) == 4 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Hidden Truth (Continue)");
			}
			if( myself::HaveMemo(talker,21) == 1 && myself::GetMemoState(talker,21) == 9 && myself::OwnItemCount(talker,7140) >= 1 && myself::GetMemoStateEx(talker,21,1) == 3 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Hidden Truth (Continue)");
			}
			if( myself::HaveMemo(talker,21) == 1 && myself::GetMemoState(talker,21) == 9 && myself::OwnItemCount(talker,7140) >= 1 && myself::GetMemoStateEx(talker,21,1) != 3 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Hidden Truth (Continue)");
			}
			if( myself::HaveMemo(talker,21) == 1 && myself::GetMemoState(talker,21) == 10 && myself::OwnItemCount(talker,7140) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Hidden Truth (Continue)");
			}
			if( talker.level >= 73 && myself::HaveMemo(talker,639) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Guardians of the Holy Grail");
			}
			if( talker.level < 73 && myself::HaveMemo(talker,639) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Guardians of the Holy Grail");
			}
			if( talker.level > 73 && myself::HaveMemo(talker,639) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 8;
				myself::AddChoice(8,"Guardians of the Holy Grail - In Progress");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,21) == 1 && myself::GetMemoState(talker,21) == 7 && myself::OwnItemCount(talker,7140) >= 1 ) )
					{
						myself::SetCurrentQuestID(21);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) )
						{
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::SetMemoState(talker,21,( myself::GetMemoState(talker,21) + 1 ));
						myself::SetMemoStateEx(talker,21,1,( myself::GetMemoStateEx(talker,21,1) + 4 ));
						myself::ShowPage(talker,"falsepriest_dominic_q0021_01.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,21) == 1 && myself::GetMemoState(talker,21) == 8 && myself::OwnItemCount(talker,7140) >= 1 && ( myself::GetMemoStateEx(talker,21,1) == 1 || myself::GetMemoStateEx(talker,21,1) == 2 ) ) )
					{
						myself::SetCurrentQuestID(21);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) )
						{
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::SetMemoState(talker,21,( myself::GetMemoState(talker,21) + 1 ));
						myself::SetMemoStateEx(talker,21,1,( myself::GetMemoStateEx(talker,21,1) + 4 ));
						myself::ShowPage(talker,"falsepriest_dominic_q0021_02.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,21) == 1 && myself::GetMemoState(talker,21) == 8 && myself::OwnItemCount(talker,7140) >= 1 && myself::GetMemoStateEx(talker,21,1) == 4 ) )
					{
						myself::SetCurrentQuestID(21);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) )
						{
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::ShowPage(talker,"falsepriest_dominic_q0021_01.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,21) == 1 && myself::GetMemoState(talker,21) == 9 && myself::OwnItemCount(talker,7140) >= 1 && myself::GetMemoStateEx(talker,21,1) == 3 ) )
					{
						myself::SetCurrentQuestID(21);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) )
						{
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::SetMemoState(talker,21,10);
						myself::ShowPage(talker,"falsepriest_dominic_q0021_03.htm");
						myself::SetFlagJournal(talker,21,7);
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,21) == 1 && myself::GetMemoState(talker,21) == 9 && myself::OwnItemCount(talker,7140) >= 1 && myself::GetMemoStateEx(talker,21,1) != 3 ) )
					{
						myself::SetCurrentQuestID(21);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) )
						{
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::ShowPage(talker,"falsepriest_dominic_q0021_02.htm");
					}
					break;
				}
				case 5:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,21) == 1 && myself::GetMemoState(talker,21) == 10 && myself::OwnItemCount(talker,7140) >= 1 ) )
					{
						myself::SetCurrentQuestID(21);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) )
						{
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::ShowPage(talker,"falsepriest_dominic_q0021_03.htm");
					}
					break;
				}
				case 6:
				{
					if( _from_choice == 0 || ( talker.level >= 73 && myself::HaveMemo(talker,639) == 0 ) )
					{
						myself::SetCurrentQuestID(639);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) )
						{
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						if( myself::GetMemoCount(talker) < 26 )
						{
							myself::FHTML_SetFileName(fhtml0,"dominic_q639_001.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",639);
							myself::ShowFHTML(talker,fhtml0);
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 7:
				{
					if( _from_choice == 0 || ( talker.level < 73 && myself::HaveMemo(talker,639) == 0 ) )
					{
						myself::SetCurrentQuestID(639);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) )
						{
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::ShowPage(talker,"dominic_q639_002.htm");
					}
					break;
				}
				case 8:
				{
					if( _from_choice == 0 || ( talker.level > 73 && myself::HaveMemo(talker,639) == 1 ) )
					{
						myself::SetCurrentQuestID(639);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) )
						{
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::ShowPage(talker,"dominic_q639_003.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker)
	{
		if( quest_id == 639 )
		{
			myself::SetMemo(talker,639);
			myself::SetMemoState(talker,639,1);
			myself::AddLog(1,talker,639);
			myself::SetFlagJournal(talker,639,1);
			myself::SoundEffect(talker,"ItemSound.quest_accept");
			myself::ShowPage(talker,"dominic_q639_003.htm");
			return;
		}
		super;
	}

}
