class 1 iker : wizard_coach
{
handler:
	EventHandler TALK_SELECTED(talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,229) == 1 && myself::OwnItemCount(talker,3309) == 1 && myself::OwnItemCount(talker,3310) == 0 && myself::OwnItemCount(talker,3317) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Test of Witchcraft (Continue)");
			}
			if( myself::HaveMemo(talker,229) == 1 && myself::OwnItemCount(talker,3309) >= 1 && myself::OwnItemCount(talker,3310) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Test of Witchcraft (Continue)");
			}
			if( myself::HaveMemo(talker,229) == 1 && myself::OwnItemCount(talker,3310) == 0 && myself::OwnItemCount(talker,3309) >= 1 && myself::OwnItemCount(talker,3317) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Test of Witchcraft (Continue)");
			}
			if( myself::HaveMemo(talker,229) == 1 && myself::OwnItemCount(talker,3324) == 1 && myself::OwnItemCount(talker,3332) == 0 && myself::OwnItemCount(talker,3334) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Test of Witchcraft (Continue)");
			}
			if( myself::HaveMemo(talker,229) == 1 && myself::OwnItemCount(talker,3334) == 0 && myself::OwnItemCount(talker,3324) >= 1 && myself::OwnItemCount(talker,3332) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Test of Witchcraft (Continue)");
			}
			if( myself::HaveMemo(talker,229) == 1 && myself::OwnItemCount(talker,3332) == 0 && myself::OwnItemCount(talker,3324) >= 1 && myself::OwnItemCount(talker,3334) >= 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Test of Witchcraft (Continue)");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,229) == 1 && myself::OwnItemCount(talker,3309) == 1 && myself::OwnItemCount(talker,3310) == 0 && myself::OwnItemCount(talker,3317) == 0 ) )
					{
						myself::SetCurrentQuestID(229);
						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,"iker_q0229_01.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,229) == 1 && myself::OwnItemCount(talker,3309) >= 1 && myself::OwnItemCount(talker,3310) >= 1 ) )
					{
						myself::SetCurrentQuestID(229);
						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::OwnItemCount(talker,3311) >= 20 && myself::OwnItemCount(talker,3312) >= 20 && myself::OwnItemCount(talker,3313) >= 20 )
						{
							if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
							{
								talker.quest_last_reward_time = myself::GetCurrentTick();
								myself::ShowPage(talker,"iker_q0229_05.htm");
								myself::DeleteItem1(talker,3310,1);
								myself::GiveItem1(talker,3317,1);
								myself::DeleteItem1(talker,3311,myself::OwnItemCount(talker,3311));
								myself::DeleteItem1(talker,3312,myself::OwnItemCount(talker,3312));
								myself::DeleteItem1(talker,3313,myself::OwnItemCount(talker,3313));
								if( myself::OwnItemCount(talker,3318) >= 1 && myself::OwnItemCount(talker,3319) >= 1 && myself::OwnItemCount(talker,3320) >= 1 && myself::OwnItemCount(talker,3321) >= 1 && myself::OwnItemCount(talker,3322) >= 1 )
								{
									myself::SetFlagJournal(talker,229,3);
								}
							}
						}
						else
						{
							myself::ShowPage(talker,"iker_q0229_04.htm");
						}
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,229) == 1 && myself::OwnItemCount(talker,3310) == 0 && myself::OwnItemCount(talker,3309) >= 1 && myself::OwnItemCount(talker,3317) >= 1 ) )
					{
						myself::SetCurrentQuestID(229);
						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,"iker_q0229_06.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,229) == 1 && myself::OwnItemCount(talker,3324) == 1 && myself::OwnItemCount(talker,3332) == 0 && myself::OwnItemCount(talker,3334) == 0 ) )
					{
						myself::SetCurrentQuestID(229);
						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,"iker_q0229_07.htm");
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,229) == 1 && myself::OwnItemCount(talker,3334) == 0 && myself::OwnItemCount(talker,3324) >= 1 && myself::OwnItemCount(talker,3332) >= 1 ) )
					{
						myself::SetCurrentQuestID(229);
						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,"iker_q0229_09.htm");
					}
					break;
				}
				case 5:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,229) == 1 && myself::OwnItemCount(talker,3332) == 0 && myself::OwnItemCount(talker,3324) >= 1 && myself::OwnItemCount(talker,3334) >= 1 ) )
					{
						myself::SetCurrentQuestID(229);
						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,"iker_q0229_10.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 229 )
		{
			myself::SetCurrentQuestID(229);
			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( ask == 229 )
		{
			if( reply == 1 )
			{
				myself::ShowPage(talker,"iker_q0229_02.htm");
			}
			if( reply == 2 )
			{
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
				{
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::ShowPage(talker,"iker_q0229_03.htm");
					myself::GiveItem1(talker,3310,1);
				}
			}
			if( reply == 3 )
			{
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
				{
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::ShowPage(talker,"iker_q0229_08.htm");
					myself::GiveItem1(talker,3332,1);
					myself::GiveItem1(talker,3331,1);
					myself::DeleteItem1(talker,3326,myself::OwnItemCount(talker,3326));
					myself::SetFlagJournal(talker,229,7);
				}
			}
		}
		super;
	}

}
