class 1 blacksmith_kluto : blacksmith
{
handler:
	EventHandler TALK_SELECTED(talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,406) != 0 && myself::OwnItemCount(talker,1203) == 0 && myself::OwnItemCount(talker,1205) >= 20 && myself::OwnItemCount(talker,1202) != 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Path to an Elven Knight (Continue)");
			}
			if( myself::HaveMemo(talker,406) != 0 && myself::OwnItemCount(talker,1203) == 0 && myself::OwnItemCount(talker,1205) >= 20 && myself::OwnItemCount(talker,1276) != 0 && myself::OwnItemCount(talker,1206) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Path to an Elven Knight (Continue)");
			}
			if( myself::HaveMemo(talker,406) != 0 && myself::OwnItemCount(talker,1203) == 0 && myself::OwnItemCount(talker,1205) >= 20 && myself::OwnItemCount(talker,1276) != 0 && myself::OwnItemCount(talker,1206) > 0 && myself::OwnItemCount(talker,1206) < 20 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Path to an Elven Knight (Continue)");
			}
			if( myself::HaveMemo(talker,406) != 0 && myself::OwnItemCount(talker,1203) == 0 && myself::OwnItemCount(talker,1205) >= 20 && myself::OwnItemCount(talker,1276) != 0 && myself::OwnItemCount(talker,1206) >= 20 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Path to an Elven Knight (Continue)");
			}
			if( myself::HaveMemo(talker,406) != 0 && myself::OwnItemCount(talker,1203) != 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Path to an Elven Knight (Continue)");
			}
			if( myself::HaveMemo(talker,418) == 1 && myself::OwnItemCount(talker,1639) == 0 && myself::OwnItemCount(talker,1638) == 0 && myself::OwnItemCount(talker,1633) && myself::OwnItemCount(talker,1634) == 0 && myself::OwnItemCount(talker,1641) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Path to an Artisan (Continue)");
			}
			if( myself::HaveMemo(talker,418) == 1 && myself::OwnItemCount(talker,1633) && ( myself::OwnItemCount(talker,1638) || myself::OwnItemCount(talker,1639) ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Path to an Artisan (Continue)");
			}
			if( myself::HaveMemo(talker,418) == 1 && myself::OwnItemCount(talker,1633) && myself::OwnItemCount(talker,1634) && myself::OwnItemCount(talker,1641) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Path to an Artisan (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,406) != 0 && myself::OwnItemCount(talker,1203) == 0 && myself::OwnItemCount(talker,1205) >= 20 && myself::OwnItemCount(talker,1202) != 0 ) )
					{
						myself::SetCurrentQuestID(406);
						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,"blacksmith_kluto_q0406_01.htm");
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,406) != 0 && myself::OwnItemCount(talker,1203) == 0 && myself::OwnItemCount(talker,1205) >= 20 && myself::OwnItemCount(talker,1276) != 0 && myself::OwnItemCount(talker,1206) == 0 ) )
					{
						myself::SetCurrentQuestID(406);
						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,"blacksmith_kluto_q0406_03.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,406) != 0 && myself::OwnItemCount(talker,1203) == 0 && myself::OwnItemCount(talker,1205) >= 20 && myself::OwnItemCount(talker,1276) != 0 && myself::OwnItemCount(talker,1206) > 0 && myself::OwnItemCount(talker,1206) < 20 ) )
					{
						myself::SetCurrentQuestID(406);
						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,"blacksmith_kluto_q0406_04.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,406) != 0 && myself::OwnItemCount(talker,1203) == 0 && myself::OwnItemCount(talker,1205) >= 20 && myself::OwnItemCount(talker,1276) != 0 && myself::OwnItemCount(talker,1206) >= 20 ) )
					{
						myself::SetCurrentQuestID(406);
						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::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
						{
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,1206,myself::OwnItemCount(talker,1206));
							myself::DeleteItem1(talker,1205,myself::OwnItemCount(talker,1205));
							if( myself::OwnItemCount(talker,1203) == 0 )
							{
								myself::GiveItem1(talker,1203,1);
								myself::DeleteItem1(talker,1276,1);
							}
							myself::ShowPage(talker,"blacksmith_kluto_q0406_05.htm");
							myself::SetFlagJournal(talker,406,6);
						}
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,406) != 0 && myself::OwnItemCount(talker,1203) != 0 ) )
					{
						myself::SetCurrentQuestID(406);
						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,"blacksmith_kluto_q0406_06.htm");
					}
					break;
				}
				case 5:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,418) == 1 && myself::OwnItemCount(talker,1639) == 0 && myself::OwnItemCount(talker,1638) == 0 && myself::OwnItemCount(talker,1633) && myself::OwnItemCount(talker,1634) == 0 && myself::OwnItemCount(talker,1641) == 0 ) )
					{
						myself::SetCurrentQuestID(418);
						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,"blacksmith_kluto_q0418_01.htm");
					}
					break;
				}
				case 6:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,418) == 1 && myself::OwnItemCount(talker,1633) && ( myself::OwnItemCount(talker,1638) || myself::OwnItemCount(talker,1639) ) ) )
					{
						myself::SetCurrentQuestID(418);
						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,"blacksmith_kluto_q0418_08.htm");
					}
					break;
				}
				case 7:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,418) == 1 && myself::OwnItemCount(talker,1633) && myself::OwnItemCount(talker,1634) && myself::OwnItemCount(talker,1641) ) )
					{
						myself::SetCurrentQuestID(418);
						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,"blacksmith_kluto_q0418_09.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 406 )
		{
			myself::SetCurrentQuestID(406);
			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 == 406 && reply == 1 )
		{
			if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
			{
				talker.quest_last_reward_time = myself::GetCurrentTick();
				if( myself::HaveMemo(talker,406) != 0 )
				{
					myself::DeleteItem1(talker,1202,myself::OwnItemCount(talker,1202));
					if( myself::OwnItemCount(talker,1276) == 0 )
					{
						myself::GiveItem1(talker,1276,1);
					}
					myself::ShowPage(talker,"blacksmith_kluto_q0406_02.htm");
					myself::SetFlagJournal(talker,406,4);
				}
			}
		}
		if( ask == 418 )
		{
			myself::SetCurrentQuestID(418);
			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 == 418 && reply == 1 )
		{
			myself::ShowPage(talker,"blacksmith_kluto_q0418_02.htm");
		}
		if( ask == 418 && reply == 2 )
		{
			myself::ShowPage(talker,"blacksmith_kluto_q0418_05.htm");
		}
		if( ask == 418 && reply == 3 )
		{
			myself::ShowPage(talker,"blacksmith_kluto_q0418_03.htm");
		}
		if( ask == 418 && reply == 4 )
		{
			if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
			{
				talker.quest_last_reward_time = myself::GetCurrentTick();
				myself::ShowPage(talker,"blacksmith_kluto_q0418_04.htm");
				myself::GiveItem1(talker,1638,1);
				myself::SetFlagJournal(talker,418,4);
			}
		}
		if( ask == 418 && reply == 5 )
		{
			myself::ShowPage(talker,"blacksmith_kluto_q0418_06.htm");
		}
		if( ask == 418 && reply == 6 )
		{
			if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
			{
				talker.quest_last_reward_time = myself::GetCurrentTick();
				myself::ShowPage(talker,"blacksmith_kluto_q0418_07.htm");
				myself::GiveItem1(talker,1638,1);
				myself::SetFlagJournal(talker,418,4);
			}
		}
		if( ask == 418 && reply == 7 && myself::OwnItemCount(talker,1633) && myself::OwnItemCount(talker,1634) && myself::OwnItemCount(talker,1641) )
		{
			if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
			{
				talker.quest_last_reward_time = myself::GetCurrentTick();
				myself::ShowPage(talker,"blacksmith_kluto_q0418_10.htm");
				myself::DeleteItem1(talker,1633,1);
				myself::DeleteItem1(talker,1634,1);
				myself::DeleteItem1(talker,1641,1);
				myself::GiveItem1(talker,1635,1);
				myself::IncrementParam(talker,0,3200);
				myself::IncrementParam(talker,1,2790);
				myself::RemoveMemo(talker,418);
				myself::AddLog(2,talker,418);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
			}
		}
		if( ask == 418 && reply == 8 )
		{
			myself::ShowPage(talker,"blacksmith_kluto_q0418_11.htm");
		}
		if( ask == 418 && reply == 9 && myself::OwnItemCount(talker,1633) && myself::OwnItemCount(talker,1634) && myself::OwnItemCount(talker,1641) )
		{
			if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
			{
				talker.quest_last_reward_time = myself::GetCurrentTick();
				myself::ShowPage(talker,"blacksmith_kluto_q0418_12.htm");
				myself::DeleteItem1(talker,1633,1);
				myself::DeleteItem1(talker,1634,1);
				myself::DeleteItem1(talker,1641,1);
				myself::GiveItem1(talker,1635,1);
				myself::IncrementParam(talker,0,3200);
				myself::IncrementParam(talker,1,2790);
				myself::RemoveMemo(talker,418);
				myself::AddLog(2,talker,418);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
			}
		}
		super;
	}

}
