@LabelIndex 384928
@StringIndex 56792
class 0 collecter_gutenhagen : citizen {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( talker.level >= 46 && gg::HaveMemo(talker,647) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Influx of Machines");
			}
			if( talker.level < 46 && gg::HaveMemo(talker,647) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Influx of Machines");
			}
			if( gg::HaveMemo(talker,647) == 1 && gg::GetMemoState(talker,647) >= ( ( 1 * 10 ) + 1 ) && gg::GetMemoState(talker,647) <= ( ( 1 * 10 ) + 2 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Influx of Machines (In Progress)");
			}
			if( _choiceN > 1 ) {
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 ) {
			switch(_code) {
				case 0: {
					if( _from_choice == 0 || ( talker.level >= 46 && gg::HaveMemo(talker,647) == 0 ) ) {
						myself::SetCurrentQuestID(647);
						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,"collecter_gutenhagen_q0647_0101.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",647);
							myself::ShowQuestFHTML(talker,fhtml0,647);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( talker.level < 46 && gg::HaveMemo(talker,647) == 0 ) ) {
						myself::SetCurrentQuestID(647);
						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::ShowQuestPage(talker,"collecter_gutenhagen_q0647_0102.htm",647);
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,647) == 1 && gg::GetMemoState(talker,647) >= ( ( 1 * 10 ) + 1 ) && gg::GetMemoState(talker,647) <= ( ( 1 * 10 ) + 2 ) ) ) {
						myself::SetCurrentQuestID(647);
						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::GetMemoState(talker,647) == ( ( 1 * 10 ) + 2 ) && gg::OwnItemCount(talker,8100) >= 500 ) {
							myself::SetHTMLCookie(talker,647,1);
							myself::ShowPage(talker,"collecter_gutenhagen_q0647_0105.htm");
						} else {
							myself::ShowPage(talker,"collecter_gutenhagen_q0647_0106.htm");
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 647 ) {
			myself::SetCurrentQuestID(647);
			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.level >= 46 ) {
				talker.quest_last_reward_time = myself::GetCurrentTick();
				myself::SetMemo(talker,647);
				myself::SetMemoState(talker,647,( ( 1 * 10 ) + 1 ));
				gg::AddLog(1,talker,647);
				myself::SetFlagJournal(talker,647,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowQuestPage(talker,"collecter_gutenhagen_q0647_0103.htm",647);
				myself::ShowQuestMark(talker,647);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,i1,quest_id,reply,talker) {
		if( ask == 647 ) {
			myself::SetCurrentQuestID(647);
			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 == 647 ) {
			i0 = myself::GetHTMLCookie(talker,647,( 2 - 1 ));
			if( i0 != -1 ) {
				if( reply == 3 && gg::HaveMemo(talker,647) == 1 && gg::GetMemoState(talker,647) >= ( ( ( 2 - 1 ) * 10 ) + 1 ) ) {
					if( gg::OwnItemCount(talker,8100) >= 500 ) {
						i1 = gg::Rand(1000);
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,8100,gg::OwnItemCount(talker,8100));
							if( i1 < 83 ) {
								myself::GiveItem1(talker,4963,1);
							} else if( i1 < ( 83 + 83 ) ) {
								myself::GiveItem1(talker,4964,1);
							} else if( i1 < ( ( 83 + 83 ) + 83 ) ) {
								myself::GiveItem1(talker,4965,1);
							} else if( i1 < ( ( ( 83 + 83 ) + 83 ) + 84 ) ) {
								myself::GiveItem1(talker,4966,1);
							} else if( i1 < ( ( ( ( 83 + 83 ) + 83 ) + 84 ) + 84 ) ) {
								myself::GiveItem1(talker,4967,1);
							} else if( i1 < ( ( ( ( ( 83 + 83 ) + 83 ) + 84 ) + 84 ) + 84 ) ) {
								myself::GiveItem1(talker,4968,1);
							} else if( i1 < ( ( ( ( ( ( 83 + 83 ) + 83 ) + 84 ) + 84 ) + 84 ) + 83 ) ) {
								myself::GiveItem1(talker,4969,1);
							} else if( i1 < ( ( ( ( ( ( ( 83 + 83 ) + 83 ) + 84 ) + 84 ) + 84 ) + 83 ) + 83 ) ) {
								myself::GiveItem1(talker,4970,1);
							} else if( i1 < ( ( ( ( ( ( ( ( 83 + 83 ) + 83 ) + 84 ) + 84 ) + 84 ) + 83 ) + 83 ) + 83 ) ) {
								myself::GiveItem1(talker,4971,1);
							} else if( i1 < ( ( ( ( ( ( ( ( ( 83 + 83 ) + 83 ) + 84 ) + 84 ) + 84 ) + 83 ) + 83 ) + 83 ) + 84 ) ) {
								myself::GiveItem1(talker,4972,1);
							} else if( i1 < ( ( ( ( ( ( ( ( ( ( 83 + 83 ) + 83 ) + 84 ) + 84 ) + 84 ) + 83 ) + 83 ) + 83 ) + 84 ) + 83 ) ) {
								myself::GiveItem1(talker,8310,1);
							} else if( i1 < ( ( ( ( ( ( ( ( ( ( ( 83 + 83 ) + 83 ) + 84 ) + 84 ) + 84 ) + 83 ) + 83 ) + 83 ) + 84 ) + 83 ) + 83 ) ) {
								myself::GiveItem1(talker,8322,1);
							}
							gg::AddLog(2,talker,647);
							gg::AddLog(3,talker,647);
							myself::RemoveMemo(talker,647);
							myself::SoundEffect(talker,"ItemSound.quest_finish");
							myself::ShowPage(talker,"collecter_gutenhagen_q0647_0201.htm");
						}
					} else {
						myself::ShowPage(talker,"collecter_gutenhagen_q0647_0202.htm");
					}
				}
			}
		}
		super;
	}

}
