class 1 sentinel_rayjien : guard_stand
{
handler:
	EventHandler TALK_SELECTED(fhtml0,talker)
	{
		if( _from_choice == 0 )
		{
			if( myself::HaveMemo(talker,260) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Hunt the Orcs");
			}
			if( myself::HaveMemo(talker,260) == 1 && myself::OwnItemCount(talker,1114) == 0 && myself::OwnItemCount(talker,1115) == 0 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Hunt the Orcs (Continue)");
			}
			if( myself::HaveMemo(talker,260) == 1 && ( myself::OwnItemCount(talker,1114) > 0 || myself::OwnItemCount(talker,1115) > 0 ) )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Hunt the Orcs (Continue)");
			}
			if( myself::HaveMemo(talker,102) == 1 && myself::OwnItemCount(talker,746) == 1 && myself::OwnItemCount(talker,1133) == 1 )
			{
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Sea of Spores Fever (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,260) == 0 )
					{
						myself::SetCurrentQuestID(260);
						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( talker.level >= 6 && talker.race == 1 )
							{
								myself::FHTML_SetFileName(fhtml0,"sentinel_rayjien_q0260_02.htm");
								myself::FHTML_SetInt(fhtml0,"quest_id",260);
								myself::ShowFHTML(talker,fhtml0);
							}
							else if( talker.race != 1 )
							{
								myself::ShowPage(talker,"sentinel_rayjien_q0260_00.htm");
							}
							else if( talker.level < 6 )
							{
								myself::ShowPage(talker,"sentinel_rayjien_q0260_01.htm");
							}
						}
						else
						{
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,260) == 1 && myself::OwnItemCount(talker,1114) == 0 && myself::OwnItemCount(talker,1115) == 0 ) )
					{
						myself::SetCurrentQuestID(260);
						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,"sentinel_rayjien_q0260_04.htm");
					}
					break;
				}
				case 2:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,260) == 1 && ( myself::OwnItemCount(talker,1114) > 0 || myself::OwnItemCount(talker,1115) > 0 ) ) )
					{
						myself::SetCurrentQuestID(260);
						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::ShowPage(talker,"sentinel_rayjien_q0260_05.htm");
							if( ( myself::OwnItemCount(talker,1114) + myself::OwnItemCount(talker,1115) ) >= 10 )
							{
								myself::GiveItem1(talker,57,( ( ( myself::OwnItemCount(talker,1114) * 12 ) + ( myself::OwnItemCount(talker,1115) * 30 ) ) + 1000 ));
							}
							else
							{
								myself::GiveItem1(talker,57,( ( myself::OwnItemCount(talker,1114) * 12 ) + ( myself::OwnItemCount(talker,1115) * 30 ) ));
							}
							if( talker.level < 25 && myself::IsNewbie(talker) && myself::IsInCategory(0,talker.occupation) && ( myself::GetMemoStateEx(talker,255,1) % 100 ) != 10 )
							{
								myself::VoiceEffect(talker,"tutorial_voice_026",1000);
								myself::GiveItem1(talker,5789,6000);
								myself::SetMemoStateEx(talker,255,1,10);
								myself::ShowQuestionMark(talker,26);
							}
							if( talker.level < 25 && myself::IsNewbie(talker) && myself::IsInCategory(1,talker.occupation) && ( myself::GetMemoStateEx(talker,255,1) % 100 ) != 10 )
							{
								myself::VoiceEffect(talker,"tutorial_voice_027",1000);
								myself::GiveItem1(talker,5790,3000);
								myself::SetMemoStateEx(talker,255,1,10);
								myself::ShowQuestionMark(talker,26);
							}
							myself::DeleteItem1(talker,1114,myself::OwnItemCount(talker,1114));
							myself::DeleteItem1(talker,1115,myself::OwnItemCount(talker,1115));
							myself::AddLog(3,talker,260);
						}
					}
					break;
				}
				case 3:
				{
					if( _from_choice == 0 || ( myself::HaveMemo(talker,102) == 1 && myself::OwnItemCount(talker,746) == 1 && myself::OwnItemCount(talker,1133) == 1 ) )
					{
						myself::SetCurrentQuestID(102);
						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,102,( ( ( ( myself::OwnItemCount(talker,1130) + myself::OwnItemCount(talker,1131) ) + myself::OwnItemCount(talker,1132) ) + myself::OwnItemCount(talker,1133) ) + myself::OwnItemCount(talker,1134) ));
						myself::DeleteItem1(talker,1133,1);
						if( ( ( ( myself::OwnItemCount(talker,1130) + myself::OwnItemCount(talker,1131) ) + myself::OwnItemCount(talker,1132) ) + myself::OwnItemCount(talker,1134) ) < 1 )
						{
							myself::SetFlagJournal(talker,102,6);
						}
						myself::ShowPage(talker,"sentinel_rayjien_q0102_01.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker)
	{
		if( quest_id == 260 )
		{
			myself::SetCurrentQuestID(260);
			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,260);
				myself::AddLog(1,talker,260);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowPage(talker,"sentinel_rayjien_q0260_03.htm");
				myself::SetFlagJournal(talker,260,1);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker)
	{
		if( ask == 260 )
		{
			myself::SetCurrentQuestID(260);
			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 == 260 )
		{
			if( reply == 2 )
			{
				myself::ShowPage(talker,"sentinel_rayjien_q0260_06.htm");
				myself::RemoveMemo(talker,260);
				myself::AddLog(2,talker,260);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
			}
			else if( reply == 1 )
			{
				myself::ShowPage(talker,"sentinel_rayjien_q0260_07.htm");
			}
		}
		super;
	}

}
