class 1 balu_kaimu_stone : citizen
{
handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,125) == 1 && myself::GetMemoState(talker,125) == 6 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"In the Name of Evil Part 1 - In Progress");
			}
			if( myself::HaveMemo(talker,125) == 1 && myself::GetMemoState(talker,125) == 7 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"In the Name of Evil Part 1 - In Progress");
			}
			if( myself::HaveMemo(talker,126) == 1 && myself::GetMemoState(talker,126) == 5 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"In the Name of Evil Part 2 - In Progress");
			}
			if( myself::HaveMemo(talker,126) == 1 && myself::GetMemoState(talker,126) == 7 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"In the Name of Evil Part 2 - In Progress");
			}
			if( myself::HaveMemo(talker,126) == 1 && myself::GetMemoState(talker,126) == 8 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"In the Name of Evil Part 2 - In Progress");
			}
			if( myself::HaveMemo(talker,126) == 1 && myself::GetMemoState(talker,126) == 6 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"In the Name of Evil Part 2 - In Progress");
			}
		}
		if( _choiceN > 1 )
		{
			myself::ShowChoicePage(talker,1);
			return;
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					myself::ShowPage(talker,"balu_kaimu_stone_q0125_01.htm");
					myself::SetCookie(talker,"balu_kaimu_stone",0);
					break;
				}
				case 1:
				{
					myself::ShowPage(talker,"balu_kaimu_stone_q0125_20.htm");
					break;
				}
				case 2:
				{
					myself::ShowPage(talker,"balu_kaimu_stone_q0126_01.htm");
					break;
				}
				case 3:
				{
					myself::ShowPage(talker,"balu_kaimu_stone_q0126_10.htm");
					break;
				}
				case 4:
				{
					myself::ShowPage(talker,"balu_kaimu_stone_q0126_12.htm");
					break;
				}
				case 5:
				{
					myself::ShowPage(talker,"balu_kaimu_stone_q0126_03.htm");
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,reply,talker)
	{
		if( ask == 125 )
		{
			myself::SetCurrentQuestID(125);
			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( reply == 1 )
			{
				myself::ShowPage(talker,"balu_kaimu_stone_q0125_05.htm");
				myself::SetCookie(talker,"balu_kaimu_stone",0);
				if( myself::GetCookie(talker,"balu_kaimu_stone") == 0 )
				{
					myself::SetCookie(talker,"balu_kaimu_stone",1);
				}
				return;
			}
			if( reply == 2 )
			{
				myself::ShowPage(talker,"balu_kaimu_stone_q0125_06.htm");
				if( myself::GetCookie(talker,"balu_kaimu_stone") == 1 )
				{
					myself::SetCookie(talker,"balu_kaimu_stone",2);
				}
				return;
			}
			if( reply == 3 )
			{
				myself::ShowPage(talker,"balu_kaimu_stone_q0125_07.htm");
				if( myself::GetCookie(talker,"balu_kaimu_stone") == 2 )
				{
					myself::SetCookie(talker,"balu_kaimu_stone",3);
				}
				return;
			}
			if( reply == 4 )
			{
				if( myself::GetCookie(talker,"balu_kaimu_stone") == 3 )
				{
					myself::ShowPage(talker,"balu_kaimu_stone_q0125_09.htm");
					myself::SetCookie(talker,"balu_kaimu_stone",0);
				}
				else
				{
					myself::ShowPage(talker,"balu_kaimu_stone_q0125_08.htm");
					myself::SetCookie(talker,"balu_kaimu_stone",0);
				}
				return;
			}
			if( reply == 5 )
			{
				myself::SetMemoState(talker,125,7);
				myself::SetFlagJournal(talker,125,7);
				myself::ShowPage(talker,"balu_kaimu_stone_q0125_20.htm");
				myself::SoundEffect(talker,"ItemSound.quest_middle");
				return;
			}
		}
		if( ask == 126 )
		{
			myself::SetCurrentQuestID(126);
			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( reply == 1 )
			{
				myself::SetMemoState(talker,126,6);
				myself::SetFlagJournal(talker,126,6);
				myself::ShowPage(talker,"balu_kaimu_stone_q0126_03.htm");
				return;
			}
			if( reply == 2 )
			{
				myself::SetMemoState(talker,126,7);
				myself::SetFlagJournal(talker,126,7);
				myself::ShowPage(talker,"balu_kaimu_stone_q0126_10.htm");
				return;
			}
			if( reply == 3 )
			{
				myself::SetMemoState(talker,126,8);
				myself::SetFlagJournal(talker,126,8);
				myself::ShowPage(talker,"balu_kaimu_stone_q0126_11.htm");
				myself::SoundEffect(talker,"ItemSound.quest_middle");
				myself::ShowQuestMark(talker,126);
				return;
			}
		}
		super;
	}

}
