@LabelIndex 261211
@StringIndex 33131
class 0 bishop_raimund : human_elf_mage_lv2_master {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,402) == 1 && gg::OwnItemCount(talker,1170) == 0 && gg::OwnItemCount(talker,1163) == 0 && gg::OwnItemCount(talker,1271) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Path of the Human Knight (In Progress)");
			}
			if( gg::HaveMemo(talker,402) == 1 && gg::OwnItemCount(talker,1170) > 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Path of the Human Knight (In Progress)");
			}
			if( gg::HaveMemo(talker,402) == 1 && gg::OwnItemCount(talker,1163) > 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Path of the Human Knight (In Progress)");
			}
			if( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) < 2 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Fallen Angel - Request of Dawn (In Progress)");
			}
			if( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) == 2 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Fallen Angel - Request of Dawn (In Progress)");
			}
			if( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) == 3 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Fallen Angel - Request of Dawn (In Progress)");
			}
			if( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) >= 4 && gg::GetMemoState(talker,142) < 9 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Fallen Angel - Request of Dawn (In Progress)");
			}
			if( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) >= 9 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Fallen Angel - Request of Dawn (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,402) == 1 && gg::OwnItemCount(talker,1170) == 0 && gg::OwnItemCount(talker,1163) == 0 && gg::OwnItemCount(talker,1271) ) ) {
						myself::SetCurrentQuestID(402);
						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,"bishop_raimund_q0402_01.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,402) == 1 && gg::OwnItemCount(talker,1170) > 0 ) ) {
						myself::SetCurrentQuestID(402);
						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( gg::OwnItemCount(talker,1171) < 12 ) {
							myself::ShowPage(talker,"bishop_raimund_q0402_04.htm");
						} else if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::ShowPage(talker,"bishop_raimund_q0402_05.htm");
							myself::DeleteItem1(talker,1171,gg::OwnItemCount(talker,1171));
							myself::DeleteItem1(talker,1170,1);
							myself::GiveItem1(talker,1163,1);
						}
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,402) == 1 && gg::OwnItemCount(talker,1163) > 0 ) ) {
						myself::SetCurrentQuestID(402);
						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,"bishop_raimund_q0402_06.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) < 2 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) ) {
						myself::SetCurrentQuestID(142);
						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,"bishop_raimund_q0142_01.htm");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) == 2 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) ) {
						myself::SetCurrentQuestID(142);
						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::DeleteItem1(talker,10351,gg::OwnItemCount(talker,10351));
						myself::SetMemoState(talker,142,3);
						myself::ShowPage(talker,"bishop_raimund_q0142_02.htm");
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) == 3 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) ) {
						myself::SetCurrentQuestID(142);
						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,"bishop_raimund_q0142_02a.htm");
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) >= 4 && gg::GetMemoState(talker,142) < 9 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) ) {
						myself::SetCurrentQuestID(142);
						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,"bishop_raimund_q0142_06.htm");
					}
					break;
				}
				case 7: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) >= 9 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) ) {
						myself::SetCurrentQuestID(142);
						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::DeleteItem1(talker,10353,gg::OwnItemCount(talker,10353));
						myself::RemoveMemo(talker,142);
						myself::SoundEffect(talker,"ItemSound.quest_finish");
						myself::ShowPage(talker,"bishop_raimund_q0142_07.htm");
						myself::SetOneTimeQuestFlag(talker,142,1);
						gg::AddLog(2,talker,142);
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
							talker.quest_last_reward_time = myself::GetCurrentTick();
							if( talker.level < 44 ) {
								myself::GiveItem1(talker,57,92676);
								myself::IncrementParam(talker,0,223036);
								myself::IncrementParam(talker,1,13901);
							} else {
								myself::GiveItem1(talker,57,92676);
							}
							gg::AddLog(3,talker,142);
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker) {
		if( ask == 402 ) {
			myself::SetCurrentQuestID(402);
			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 == 402 ) {
			if( reply = 1 ) {
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::ShowPage(talker,"bishop_raimund_q0402_03.htm");
					myself::GiveItem1(talker,1170,1);
				}
			} else {
			}
		}
		if( ask == 142 ) {
			myself::SetCurrentQuestID(142);
			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 == 142 ) {
			if( reply == 3 ) {
				if( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) == 3 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) {
					myself::ShowPage(talker,"bishop_raimund_q0142_03.htm");
				}
			}
			if( reply == 4 ) {
				if( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) == 3 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) {
					myself::ShowPage(talker,"bishop_raimund_q0142_04.htm");
				}
			}
			if( reply == 5 ) {
				if( gg::HaveMemo(talker,142) == 1 && gg::GetMemoState(talker,142) == 3 && myself::GetOneTimeQuestFlag(talker,142) == 0 ) {
					myself::SetMemoState(talker,142,4);
					myself::ShowPage(talker,"bishop_raimund_q0142_05.htm");
					myself::SetFlagJournal(talker,142,3);
					myself::ShowQuestMark(talker,142);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
		}
		super;
	}

}
