@LabelIndex 351293
@StringIndex 50096
class 0 watcher_valakas_klein : ai_boss07_teleporter {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( talker.level >= 60 && gg::HaveMemo(talker,618) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Into the flames");
			}
			if( talker.level < 60 && gg::HaveMemo(talker,618) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Into the flames");
			}
			if( gg::HaveMemo(talker,618) == 1 && gg::GetMemoState(talker,618) == ( ( 1 * 10 ) + 1 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Into the flames (In Progress)");
			}
			if( gg::HaveMemo(talker,618) == 1 && gg::OwnItemCount(talker,7266) >= 1 && gg::GetMemoState(talker,618) == ( ( 3 * 10 ) + 1 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Into the flames (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 >= 60 && gg::HaveMemo(talker,618) == 0 ) ) {
						myself::SetCurrentQuestID(618);
						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,"watcher_valakas_klein_q0618_0101.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",618);
							myself::ShowQuestFHTML(talker,fhtml0,618);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( talker.level < 60 && gg::HaveMemo(talker,618) == 0 ) ) {
						myself::SetCurrentQuestID(618);
						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,"watcher_valakas_klein_q0618_0103.htm",618);
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,618) == 1 && gg::GetMemoState(talker,618) == ( ( 1 * 10 ) + 1 ) ) ) {
						myself::SetCurrentQuestID(618);
						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,"watcher_valakas_klein_q0618_0105.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,618) == 1 && gg::OwnItemCount(talker,7266) >= 1 && gg::GetMemoState(talker,618) == ( ( 3 * 10 ) + 1 ) ) ) {
						myself::SetCurrentQuestID(618);
						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::SetHTMLCookie(talker,618,3);
						myself::ShowPage(talker,"watcher_valakas_klein_q0618_0301.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

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

	EventHandler MENU_SELECTED(ask,i0,i1,quest_id,reply,talker) {
		if( ask == 617 ) {
			myself::SetCurrentQuestID(617);
			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 == 618 ) {
			if( reply == 101 ) {
				i0 = 0;
				i0 = ( ( ( myself.i_ai3 + myself.i_ai2 ) + myself.i_ai1 ) + myself.i_ai0 );
				if( i0 < 50 ) {
					myself::ShowPage(talker,"watcher_valakas_klein003.htm");
				} else if( i0 < 100 ) {
					myself::ShowPage(talker,"watcher_valakas_klein004.htm");
				} else if( i0 < 150 ) {
					myself::ShowPage(talker,"watcher_valakas_klein005.htm");
				} else if( i0 < 200 ) {
					myself::ShowPage(talker,"watcher_valakas_klein006.htm");
				} else {
					myself::ShowPage(talker,"watcher_valakas_klein007.htm");
				}
			}
		}
		if( ask == 618 ) {
			myself::SetCurrentQuestID(618);
			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 == 618 ) {
			i0 = myself::GetHTMLCookie(talker,618,( 4 - 1 ));
			if( i0 != -1 ) {
				if( reply == 3 && gg::HaveMemo(talker,618) == 1 ) {
					if( gg::OwnItemCount(talker,7266) >= 1 ) {
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,7266,gg::OwnItemCount(talker,7266));
							myself::GiveItem1(talker,7267,1);
						}
						gg::AddLog(2,talker,618);
						gg::AddLog(3,talker,618);
						myself::RemoveMemo(talker,618);
						myself::SoundEffect(talker,"ItemSound.quest_finish");
						myself::ShowPage(talker,"watcher_valakas_klein_q0618_0401.htm");
					} else {
						myself::ShowPage(talker,"watcher_valakas_klein_q0618_0402.htm");
					}
				}
			}
		}
		super;
	}

}
