@LabelIndex 377682
@StringIndex 55487
class 0 holding_cornerstone : citizen {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,242) == 1 && talker.subjob_id == 0 && myself::GetOneTimeQuestFlag(talker,242) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Path of the Noblesse, Precious Soul - 2 (In Progress)");
			}
			if( gg::HaveMemo(talker,242) == 1 && talker.subjob_id != 0 && gg::OwnItemCount(talker,7595) < 1 && gg::GetMemoState(talker,242) == 9 && myself::GetOneTimeQuestFlag(talker,242) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Path of the Noblesse, Precious Soul - 2 (In Progress)");
			}
			if( gg::HaveMemo(talker,242) == 1 && talker.subjob_id != 0 && gg::OwnItemCount(talker,7595) >= 1 && gg::GetMemoState(talker,242) == 9 && myself::GetOneTimeQuestFlag(talker,242) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Path of the Noblesse, Precious Soul - 2 (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,242) == 1 && talker.subjob_id == 0 && myself::GetOneTimeQuestFlag(talker,242) == 0 ) ) {
						myself::SetCurrentQuestID(242);
						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,"quest_not_subclass001.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,242) == 1 && talker.subjob_id != 0 && gg::OwnItemCount(talker,7595) < 1 && gg::GetMemoState(talker,242) == 9 && myself::GetOneTimeQuestFlag(talker,242) == 0 ) ) {
						myself::SetCurrentQuestID(242);
						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,"holding_cornerstone_q0242_01.htm");
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,242) == 1 && talker.subjob_id != 0 && gg::OwnItemCount(talker,7595) >= 1 && gg::GetMemoState(talker,242) == 9 && myself::GetOneTimeQuestFlag(talker,242) == 0 ) ) {
						myself::SetCurrentQuestID(242);
						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,"holding_cornerstone_q0242_02.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,reply,talker) {
		if( ask == 242 ) {
			myself::SetCurrentQuestID(242);
			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 == 242 ) {
			if( reply == 1 && gg::GetMemoState(talker,242) == 9 ) {
				i0 = gg::GetMemoStateEx(talker,242,1);
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					if( gg::GetMemoStateEx(talker,242,1) >= 3 ) {
						myself::SetMemoState(talker,242,10);
						myself::SetFlagJournal(talker,242,10);
						myself::ShowQuestMark(talker,242);
						myself::SoundEffect(talker,"ItemSound.quest_middle");
						myself::DeleteItem1(talker,7595,gg::OwnItemCount(talker,7595));
						myself::ShowPage(talker,"holding_cornerstone_q0242_03.htm");
						myself::AddUseSkillDesire(talker,297926657,0,0,1000000);
						myself::Despawn();
					} else {
						myself::SetMemoStateEx(talker,242,1,( i0 + 1 ));
						myself::DeleteItem1(talker,7595,1);
						myself::ShowPage(talker,"holding_cornerstone_q0242_03.htm");
						myself::AddUseSkillDesire(talker,297926657,0,0,1000000);
						myself::Despawn();
					}
				}
			}
		}
		super;
	}

}
