class 1 guard_luis : guard_stand
{
handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( talker.level >= 19 && myself::HaveMemo(talker,38) == 0 && myself::GetOneTimeQuestFlag(talker,38) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Dragon Fangs");
			}
			if( talker.level < 19 && myself::HaveMemo(talker,38) == 0 && myself::GetOneTimeQuestFlag(talker,38) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Dragon Fangs");
			}
			if( myself::HaveMemo(talker,38) == 0 && myself::GetOneTimeQuestFlag(talker,38) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Dragon Fangs (End)");
			}
			if( myself::HaveMemo(talker,38) == 1 && myself::GetMemoState(talker,38) >= ( ( 1 * 10 ) + 1 ) && myself::GetMemoState(talker,38) <= ( ( 1 * 10 ) + 2 ) && myself::GetOneTimeQuestFlag(talker,38) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Dragon Fangs (Continue)");
			}
			if( myself::HaveMemo(talker,38) == 1 && myself::GetMemoState(talker,38) == ( ( 2 * 10 ) + 1 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Dragon Fangs (Continue)");
			}
			if( _choiceN > 1 )
			{
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 )
		{
			switch(_code)
			{
				case 0:
				{
					if( _from_choice == 0 || ( talker.level >= 19 && myself::HaveMemo(talker,38) == 0 && myself::GetOneTimeQuestFlag(talker,38) == 0 ) )
					{
						myself::SetCurrentQuestID(38);
						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 )
						{
							if( ( ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 1 ) || 0 == 0 ) && ( ( 0 == 1 && myself::GetOneTimeQuestFlag(talker,0) == 1 ) || 0 == 0 ) ) && ( ( 0 == 1 && talker.subjob_id != 0 ) || 0 == 0 ) )
							{
								myself::FHTML_SetFileName(fhtml0,"guard_luis_q0038_0101.htm");
								myself::FHTML_SetInt(fhtml0,"quest_id",38);
								myself::ShowFHTML(talker,fhtml0);
							}
							else
							{
								myself::ShowPage(talker,"guard_luis_q0038_0102.htm");
							}
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( talker.level < 19 && myself::HaveMemo(talker,38) == 0 && myself::GetOneTimeQuestFlag(talker,38) == 0 ) )
					{
						myself::SetCurrentQuestID(38);
						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,"guard_luis_q0038_0103.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,38) == 0 && myself::GetOneTimeQuestFlag(talker,38) == 1 ) )
					{
						myself::SetCurrentQuestID(38);
						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,"finishedquest.htm");
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,38) == 1 && myself::GetMemoState(talker,38) >= ( ( 1 * 10 ) + 1 ) && myself::GetMemoState(talker,38) <= ( ( 1 * 10 ) + 2 ) && myself::GetOneTimeQuestFlag(talker,38) == 0 ) )
					{
						myself::SetCurrentQuestID(38);
						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::GetMemoState(talker,38) == ( ( 1 * 10 ) + 2 ) && ( ( 1 == 1 && myself::OwnItemCount(talker,7173) >= 100 ) || 1 == 0 ) ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) )
						{
							myself::SetHTMLCookie(talker,38,1);
							myself::ShowPage(talker,"guard_luis_q0038_0105.htm");
						}
						else
						{
							myself::ShowPage(talker,"guard_luis_q0038_0106.htm");
						}
					}
					break;
				}
				case 4:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,38) == 1 && myself::GetMemoState(talker,38) == ( ( 2 * 10 ) + 1 ) ) )
					{
						myself::SetCurrentQuestID(38);
						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,"guard_luis_q0038_0203.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker)
	{
		if( quest_id == 38 )
		{
			myself::SetCurrentQuestID(38);
			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::SetMemo(talker,38);
				myself::SetMemoState(talker,38,( ( 1 * 10 ) + 1 ));
				myself::AddLog(1,talker,38);
				myself::SetFlagJournal(talker,38,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowPage(talker,"guard_luis_q0038_0104.htm");
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,quest_id,reply,talker)
	{
		if( ask == 38 )
		{
			myself::SetCurrentQuestID(38);
			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 == 38 )
		{
			i0 = myself::GetHTMLCookie(talker,38,( 2 - 1 ));
			if( i0 != -1 )
			{
				if( reply == 1 && myself::HaveMemo(talker,38) == 1 )
				{
					if( ( ( ( 1 == 1 && myself::OwnItemCount(talker,7173) >= 100 ) || 1 == 0 ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) ) && ( ( 0 == 1 && myself::OwnItemCount(talker,0) >= 0 ) || 0 == 0 ) )
					{
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 )
						{
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,7173,100);
							myself::DeleteItem1(talker,0,0);
							myself::DeleteItem1(talker,0,0);
							myself::GiveItem1(talker,7174,1);
							myself::ShowPage(talker,"guard_luis_q0038_0201.htm");
							myself::SetMemoState(talker,38,( ( 2 * 10 ) + 1 ));
							myself::SetFlagJournal(talker,38,3);
							myself::SoundEffect(talker,"ItemSound.quest_middle");
						}
					}
					else
					{
						myself::ShowPage(talker,"guard_luis_q0038_0202.htm");
					}
				}
			}
		}
		super;
	}

}
