@LabelIndex 397065
@StringIndex 59345
class 0 jude : npc_jude {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,690) == 0 && talker.level >= 78 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Jude's Request");
			}
			if( gg::HaveMemo(talker,690) == 0 && talker.level < 78 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Jude's Request");
			}
			if( gg::HaveMemo(talker,690) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Jude's Request (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,690) == 0 && talker.level >= 78 ) ) {
						myself::SetCurrentQuestID(690);
						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 ) {
							myself::FHTML_SetFileName(fhtml0,"jude_q0690_01.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",690);
							myself::ShowQuestFHTML(talker,fhtml0,690);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,690) == 0 && talker.level < 78 ) ) {
						myself::SetCurrentQuestID(690);
						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,"jude_q0690_02.htm");
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || gg::HaveMemo(talker,690) == 1 ) {
						myself::SetCurrentQuestID(690);
						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,10327) >= 200 ) {
							myself::ShowPage(talker,"jude_q0690_04.htm");
						} else if( gg::OwnItemCount(talker,10327) < 5 ) {
							myself::ShowPage(talker,"jude_q0690_05a.htm");
						} else if( gg::OwnItemCount(talker,10327) < 200 ) {
							myself::ShowPage(talker,"jude_q0690_05.htm");
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 690 ) {
			myself::SetCurrentQuestID(690);
			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();
				if( gg::HaveMemo(talker,690) == 0 && talker.level >= 78 ) {
					myself::SetMemoState(talker,690,1);
					myself::SetMemo(talker,quest_id);
					myself::SoundEffect(talker,"ItemSound.quest_accept");
					myself::ShowQuestPage(talker,"jude_q0690_03.htm",690);
					myself::SetFlagJournal(talker,690,1);
					myself::ShowQuestMark(talker,690);
				}
				gg::AddLog(1,talker,quest_id);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,reply,talker) {
		if( ask == 690 ) {
			myself::SetCurrentQuestID(690);
			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 == 690 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,690) == 1 ) {
					myself::ShowPage(talker,"jude_q0690_06.htm");
				}
			}
			if( reply == 3 ) {
				if( gg::HaveMemo(talker,690) == 1 ) {
					if( gg::OwnItemCount(talker,10327) >= 200 ) {
						i0 = gg::Rand(9);
						switch(i0) {
							case 0: {
								myself::GiveItem1(talker,10373,1);
								break;
							}
							case 1: {
								myself::GiveItem1(talker,10374,1);
								break;
							}
							case 2: {
								myself::GiveItem1(talker,10375,1);
								break;
							}
							case 3: {
								myself::GiveItem1(talker,10376,1);
								break;
							}
							case 4: {
								myself::GiveItem1(talker,10377,1);
								break;
							}
							case 5: {
								myself::GiveItem1(talker,10378,1);
								break;
							}
							case 6: {
								myself::GiveItem1(talker,10379,1);
								break;
							}
							case 7: {
								myself::GiveItem1(talker,10380,1);
								break;
							}
							case 8: {
								myself::GiveItem1(talker,10381,1);
								break;
							}
						}
						myself::DeleteItem1(talker,10327,200);
						myself::SoundEffect(talker,"ItemSound.quest_middle");
						gg::AddLog(3,talker,690);
						myself::ShowPage(talker,"jude_q0690_07.htm");
					} else {
						myself::ShowPage(talker,"jude_q0690_07a.htm");
					}
				}
			}
			if( reply == 4 ) {
				if( gg::HaveMemo(talker,690) == 1 ) {
					myself::DeleteItem1(talker,10327,gg::OwnItemCount(talker,10327));
					myself::RemoveMemo(talker,690);
					myself::SoundEffect(talker,"ItemSound.quest_finish");
					myself::ShowPage(talker,"jude_q0690_08.htm");
					gg::AddLog(2,talker,690);
				}
			}
			if( reply == 5 ) {
				if( gg::OwnItemCount(talker,10327) >= 5 ) {
					i0 = gg::Rand(9);
					switch(i0) {
						case 0: {
							myself::GiveItem1(talker,10397,3);
							break;
						}
						case 1: {
							myself::GiveItem1(talker,10398,3);
							break;
						}
						case 2: {
							myself::GiveItem1(talker,10399,3);
							break;
						}
						case 3: {
							myself::GiveItem1(talker,10400,3);
							break;
						}
						case 4: {
							myself::GiveItem1(talker,10401,3);
							break;
						}
						case 5: {
							myself::GiveItem1(talker,10402,3);
							break;
						}
						case 6: {
							myself::GiveItem1(talker,10403,3);
							break;
						}
						case 7: {
							myself::GiveItem1(talker,10404,3);
							break;
						}
						case 8: {
							myself::GiveItem1(talker,10405,3);
							break;
						}
					}
					myself::DeleteItem1(talker,10327,5);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
					gg::AddLog(3,talker,690);
					myself::ShowPage(talker,"jude_q0690_09.htm");
				} else {
					myself::ShowPage(talker,"jude_q0690_09a.htm");
				}
			}
		}
		super;
	}

}
