@LabelIndex 385823
@StringIndex 56960
class 0 statue_of_shilen : sailren_quest_npc {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) == 402 && gg::OwnItemCount(talker,8783) >= 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"The Name of Evil 2 (In Progress)");
			}
			if( gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) < 402 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"The Name of Evil 2 (In Progress)");
			}
			if( gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) > 406 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"The Name of Evil 2 (In Progress)");
			}
			if( gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) == 404 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"The Name of Evil 2 (In Progress)");
			}
			if( gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) == 405 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"The Name of Evil 2 (In Progress)");
			}
			if( gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) == 406 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"The Name of Evil 2 (In Progress)");
			}
			if( gg::HaveMemo(talker,641) == 0 && talker.level >= 77 && myself::GetOneTimeQuestFlag(talker,126) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Sailren's Charge!");
			}
			if( gg::HaveMemo(talker,641) == 0 && talker.level >= 77 && myself::GetOneTimeQuestFlag(talker,126) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Sailren's Charge!");
			}
			if( gg::HaveMemo(talker,641) == 0 && talker.level < 77 && myself::GetOneTimeQuestFlag(talker,126) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 8;
				myself::AddChoice(8,"Sailren's Charge!");
			}
			if( gg::HaveMemo(talker,641) == 1 && gg::OwnItemCount(talker,8782) < 30 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 9;
				myself::AddChoice(9,"Sailren's Charge! (In Progress)");
			}
			if( gg::HaveMemo(talker,641) == 1 && gg::OwnItemCount(talker,8782) >= 30 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 10;
				myself::AddChoice(10,"Sailren's Charge! (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,126) == 1 && gg::GetMemoState(talker,126) == 402 && gg::OwnItemCount(talker,8783) >= 1 ) ) {
						myself::SetCurrentQuestID(126);
						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,"statue_of_shilen_q0126_02.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) < 402 ) ) {
						myself::SetCurrentQuestID(126);
						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,"statue_of_shilen_q0126_03.htm");
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) > 406 ) ) {
						myself::SetCurrentQuestID(126);
						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,"statue_of_shilen_q0126_04.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) == 404 ) ) {
						myself::SetCurrentQuestID(126);
						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,"statue_of_shilen_q0126_06.htm");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) == 405 ) ) {
						myself::SetCurrentQuestID(126);
						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,"statue_of_shilen_q0126_14.htm");
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) == 406 ) ) {
						myself::SetCurrentQuestID(126);
						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,"statue_of_shilen_q0126_20.htm");
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,641) == 0 && talker.level >= 77 && myself::GetOneTimeQuestFlag(talker,126) == 1 ) ) {
						myself::SetCurrentQuestID(641);
						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,"statue_of_shilen_q0641_01.htm",641);
					}
					break;
				}
				case 7: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,641) == 0 && talker.level >= 77 && myself::GetOneTimeQuestFlag(talker,126) == 0 ) ) {
						myself::SetCurrentQuestID(641);
						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,"statue_of_shilen_q0641_02.htm",641);
					}
					break;
				}
				case 8: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,641) == 0 && talker.level < 77 && myself::GetOneTimeQuestFlag(talker,126) == 1 ) ) {
						myself::SetCurrentQuestID(641);
						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,"statue_of_shilen_q0641_03.htm",641);
					}
					break;
				}
				case 9: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,641) == 1 && gg::OwnItemCount(talker,8782) < 30 ) ) {
						myself::SetCurrentQuestID(641);
						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,"statue_of_shilen_q0641_06.htm");
					}
					break;
				}
				case 10: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,641) == 1 && gg::OwnItemCount(talker,8782) >= 30 ) ) {
						myself::SetCurrentQuestID(641);
						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,"statue_of_shilen_q0641_07.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 641 ) {
			myself::SetCurrentQuestID(641);
			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::HaveMemo(talker,641) == 0 && talker.level >= 77 && myself::GetOneTimeQuestFlag(talker,126) == 1 ) {
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::SetMemo(talker,641);
					myself::SetMemoState(talker,641,1);
					myself::ShowQuestMark(talker,641);
					myself::SoundEffect(talker,"ItemSound.quest_accept");
					myself::ShowQuestPage(talker,"statue_of_shilen_q0641_05.htm",641);
					gg::AddLog(1,talker,641);
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,fhtml0,reply,talker) {
		if( ask == 126 ) {
			myself::SetCurrentQuestID(126);
			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 == 126 ) {
			if( reply == 1 && gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) == 402 && gg::OwnItemCount(talker,8783) >= 1 ) {
				myself::SetMemoState(talker,126,404);
				myself::ShowPage(talker,"statue_of_shilen_q0126_05.htm");
				myself::SetFlagJournal(talker,126,19);
				myself::ShowQuestMark(talker,126);
				myself::SoundEffect(talker,"ItemSound.quest_middle");
			}
			if( reply == 2 && gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) == 404 ) {
				myself::ShowPage(talker,"statue_of_shilen_q0126_07.htm");
			}
			if( reply == 3 ) {
				myself::ShowPage(talker,"statue_of_shilen_q0126_08.htm");
			}
			if( reply == 4 ) {
				myself::ShowPage(talker,"statue_of_shilen_q0126_10.htm");
			}
			if( reply == 5 ) {
				myself::ShowPage(talker,"statue_of_shilen_q0126_11.htm");
			}
			if( reply == 6 ) {
				myself::ShowPage(talker,"statue_of_shilen_q0126_12.htm");
			}
			if( reply == 7 && gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) == 404 ) {
				myself::SetMemoState(talker,126,405);
				myself::ShowPage(talker,"statue_of_shilen_q0126_13.htm");
			}
			if( reply == 8 && gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) == 405 ) {
				myself::ShowPage(talker,"statue_of_shilen_q0126_15.htm");
			}
			if( reply == 9 ) {
				myself::ShowPage(talker,"statue_of_shilen_q0126_16.htm");
			}
			if( reply == 10 ) {
				myself::ShowPage(talker,"statue_of_shilen_q0126_17.htm");
			}
			if( reply == 11 ) {
				myself::ShowPage(talker,"statue_of_shilen_q0126_18.htm");
			}
			if( reply == 12 && gg::HaveMemo(talker,126) == 1 && gg::GetMemoState(talker,126) == 405 ) {
				myself::DeleteItem1(talker,8783,gg::OwnItemCount(talker,8783));
				myself::SetMemoState(talker,126,406);
				myself::ShowPage(talker,"statue_of_shilen_q0126_19.htm");
				myself::SetFlagJournal(talker,126,20);
				myself::ShowQuestMark(talker,126);
				myself::SoundEffect(talker,"ItemSound.quest_middle");
			}
		}
		if( ask == 641 ) {
			myself::SetCurrentQuestID(641);
			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 == 641 ) {
			if( reply == 2 ) {
				if( myself::GetMemoCount(talker) < 26 ) {
					myself::FHTML_SetFileName(fhtml0,"statue_of_shilen_q0641_04.htm");
					myself::FHTML_SetInt(fhtml0,"quest_id",641);
					myself::ShowQuestFHTML(talker,fhtml0,641);
				} else {
					myself::ShowPage(talker,"fullquest.htm");
				}
			}
			if( reply == 4 ) {
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					if( gg::OwnItemCount(talker,8782) >= 30 ) {
						gg::AddLog(2,talker,641);
						gg::AddLog(3,talker,641);
						myself::GiveItem1(talker,8784,1);
						myself::DeleteItem1(talker,8782,gg::OwnItemCount(talker,8782));
						myself::RemoveMemo(talker,641);
						myself::SoundEffect(talker,"ItemSound.quest_finish");
						myself::ShowPage(talker,"statue_of_shilen_q0641_08.htm");
					}
				}
			}
		}
		super;
	}

}
