@LabelIndex 291092
@StringIndex 38506
class 0 uruha : citizen {
handler:
	EventHandler TALK_SELECTED(talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,215) == 1 && gg::GetMemoState(talker,215) == 14 && gg::OwnItemCount(talker,2732) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Trial of the Pilgrim (In Progress)");
			}
			if( gg::HaveMemo(talker,215) == 1 && gg::GetMemoState(talker,215) == 15 && gg::OwnItemCount(talker,2731) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Trial of the Pilgrim (In Progress)");
			}
			if( _choiceN > 1 ) {
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 ) {
			switch(_code) {
				case 0: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,215) == 1 && gg::GetMemoState(talker,215) == 14 && gg::OwnItemCount(talker,2732) ) ) {
						myself::SetCurrentQuestID(215);
						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,"uruha_q0215_01.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,215) == 1 && gg::GetMemoState(talker,215) == 15 && gg::OwnItemCount(talker,2731) ) ) {
						myself::SetCurrentQuestID(215);
						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,"uruha_q0215_03.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker) {
		if( ask == 215 ) {
			myself::SetCurrentQuestID(215);
			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 == 215 ) {
			if( reply == 1 && gg::OwnItemCount(talker,2732) > 0 && gg::GetMemoState(talker,215) == 14 ) {
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::ShowPage(talker,"uruha_q0215_02.htm");
					myself::GiveItem1(talker,2731,1);
					myself::DeleteItem1(talker,2732,1);
					myself::SetMemoState(talker,215,15);
					myself::SetFlagJournal(talker,215,15);
					myself::ShowQuestMark(talker,215);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
		}
		super;
	}

}
